Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve socrata api upload script #580

Open
wrridgeway opened this issue Sep 5, 2024 · 0 comments
Open

Improve socrata api upload script #580

wrridgeway opened this issue Sep 5, 2024 · 0 comments

Comments

@wrridgeway
Copy link
Member

          **[Thought, non-blocking]** One high-level thought that I have for you about the design of the functions in this module: Currently, there are three possible filter conditions (no filters; all filters; or year _but not_ township filter) and each one of the `build_query`, `generate_groups`, and `upload` functions are responsible for implementing a different solution for each condition. This works fine, but it makes the functions hard to read since each one has its own set of complex conditional branches, and if we ever needed to alter those conditions or add a new one I think we would find ourselves having to basically rewrite the whole module to accommodate the new or changed condition.

I think there's potential for a simpler design that consolidates all of the responsibility for evaluating the filters in the generate_groups function, which could return a list of groups that could then be operated on by each of the build_query and upload functions agnostic of the exact contents of the filters themselves. This is a bit speculative, so I would be happy to take a stab at a follow-up PR to demonstrate a refactor if you're interested but not sure what I mean. Let me know and we can hash it out! But I don't think it's necessary to get too deep into it while you're still trying to just get the functionality up and running.

Originally posted by @jeancochrane in #566 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant