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 comma missing from #15382. #15429
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Improve DB performance of clearing out old data from `stream_ordering_to_exterm`. |
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.
Anyway for the linting to catch this?
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.
synapse/synapse/storage/database.py
Lines 397 to 398 in 6d6fcc9
args: Tuple[Any]
maybe?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.
Oh, that's actually already the case. If
*args: T
thenargs: Tuple[T]
. So hereargs: Tuple[Any]
.Tracing it through:
_do_execute_
is annotated to require thatself.txn.execute(sql, *args)
is type-safe.synapse/synapse/storage/database.py
Lines 415 to 421 in bd4d958
self.txn
is aCursor
andCursor.execute
is annotated assynapse/synapse/storage/types.py
Lines 34 to 39 in ffc2ee5
So for
self.txn.execute(sql, *args)
to be type-correct, we need*args
to contain exactly one argumentarg[0]
which is a_Parameters
instance. In this situationarg[0] : Any
so this trivially passes.I think the signature for
execute
is wrong. I think it should match that ofself.txn.execute
and take a_Parameters
.Well, consider me sniped. I'm going to see if I can PR this.
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.
-> #15432