Conversation
duncathan
reviewed
Jan 28, 2025
Contributor
duncathan
left a comment
There was a problem hiding this comment.
seems as good a time as any to leave my general feedback here:
- I strongly recommend using snake_case keys in the schema for better adherence to the python style guide in the generated TypedDict definitions
- the KEY_WHATEVER constants are an antipattern imo. using normal string literals will be better for basically everything. if you want to rename a key, rename it in the generated file with your IDE's rename function and then update the schema
- it's a bit surprising that so many keys in your schema aren't required. I find it's best to have as few optional fields as are necessary. I recommend using the ValidatorWithDefault tool we use in ODR, OPR, caver, etc. to automatically fill in defaults before validating the schema. then you can mark any field with a default as required and avoid messing around with
get()and whatnot
Contributor
Author
|
posted in discord but will post here for posterity too
generally agree with you on these these but would like to address them in seperate PRs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 1 of not-sure-how-many that tries to add better typing/cleanup to the patcher data that is currently mostly just dict[Any, Any].