This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add type hints to synapse/storage/databases/main/events_worker.py
#11411
Merged
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
9f409cb
Add docstrings to `AbstractStreamIdGenerator` methods
2ce1c29
Create `AbstractStreamIdTracker` base class
6122b30
Make `_push_rules_stream_id_gen` an `AbstractStreamIdTracker`
a1c5c48
Remove duplicate `_EventCacheEntry` definition
c463c9d
Fix type hints for `SQLBaseStore.process_replication_rows`
ba8af67
Fix tpye hint for `_EventRow.room_version_id`
6cf127b
`_enqueue_events` needs a `Collection` since it uses `len()`
de0585a
`get_events_as_list` needs a `Collection`
5de79f1
Add type hints to `synapse/storage/databases/main/events_worker.py`
9bac798
Add newsfile
b40e5c4
Address PR feedback
50742a0
Improve IdGenerator docstrings
b4dbe02
Merge branch 'develop' into squah/type_hint_events_worker
squahtx ad514de
Fix typo in docstring
87fe9c6
Fix merge
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
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'd argue that these bits of docs shouldn't be removed, i'll note them in the next few comments.
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.
They've been moved into
AbstractStreamId{Generator,Tracker}
. I was under the impression that IDEs would pick it up automatically. inspect.getdoc is noted to do the right thing.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.
Ah, interesting, though i'd like a confirmation from a synapse member on this change, because im not 100% sure myself
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’ll be closing the other comments, apologies if it came over as overwhelming, I simply meant to highlight all places where this issued occurred without much duplication
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.
Not a problem!
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.
This seems utterly reasonable.
There's also a
class IdGenerator
. I guess that aStreamIdGenerator
is more specific and that the two aren't directly related?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 wasn't feeling up for making sense of
IdGenerator
and unifying it with the stream id generators. They do look vaguely similar.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
IdGenerator
is far simpler thanStreamIdGenerator
. The former only issues IDs while the latter has to track when they are committed.