-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
csv_overrides: Add stronger type hints #1851
base: main
Are you sure you want to change the base?
Conversation
|
||
def check_for_duplicates( | ||
filename: str, default_values: Mapping[str, Mapping[str, str]] | ||
): | ||
results_map = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't see what type this is supposed to be... because I don't think any items are ever assigned to this 😕
I recall this bit was in one of the other functions previously. Think this ended up being broken after a recent refactor.
file_path = get_full_path(filename) | ||
super_default_values = get_super_values(default_values) | ||
assert allow_unknown_values == (default_list_name is not None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out we have dependent types here! It would've been too annoying to check both allow_unknown_values
and default_list_name
in update_dicts
to appease the type checker, but I'm also too lazy to update the callers of init_csv_and_watch_changes
right now.
I see this is still draft—did you want me to have a look or wanted to make some changes first? |
It'd probably make sense to address the above issue first, since as it stands there are no types that are coherent in |
Ah right yeah makes sense |
Checklist