Conversation
This is largely teaching mypy about the gen/ path, removing those `type-ignore` comments on the imports, and then fixing up the aftermath. There's also a bit of type narrowing, minor 'Pythonic' tweaks, and unpinning the types-protobuf dependency (and fixing those lints), so that we can eventually get better types 😄.
d5e5b7a to
ee8b056
Compare
stefanvanburen
commented
Aug 26, 2025
| field.has_presence and not for_items | ||
| ) | ||
| self._required = field_level.required | ||
| type_case = field_level.WhichOneof("type") |
Member
Author
There was a problem hiding this comment.
already set above
stefanvanburen
commented
Aug 26, 2025
Comment on lines
+1085
to
+1086
| rules: list[Rules] = self._factory.get(self._field.message_type) | ||
| if not rules: |
Member
Author
There was a problem hiding this comment.
noticed we weren't exiting early here, since self._factory.get is never returning None. Switched to check if we have any rules in the list. Should be slightly faster.
Alfus
approved these changes
Aug 26, 2025
rodaine
reviewed
Aug 26, 2025
|
|
||
|
|
||
| def make_timestamp(msg: message.Message) -> celtypes.TimestampType: | ||
| def make_timestamp(msg: duration_pb2.Duration) -> celtypes.TimestampType: |
Member
There was a problem hiding this comment.
Should this be a timestamp_pb2.Timestamp?
stefanvanburen
added a commit
that referenced
this pull request
Aug 26, 2025
Merged
stefanvanburen
added a commit
that referenced
this pull request
Aug 26, 2025
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.
This is largely teaching mypy about the gen/ path, removing those
type-ignorecomments on the imports, and then fixing up the aftermath.There's also a bit of type narrowing, minor 'Pythonic' tweaks, and tweaking the types-protobuf dependency (and fixing those lints), so that we can eventually get better types 😄.