-
Notifications
You must be signed in to change notification settings - Fork 1.1k
refactor: replace current windowed query #13845
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
Merged
miketheman
merged 3 commits into
pypi:main
from
miketheman:miketheman/refactor-windowed-query
Jun 8, 2023
Merged
refactor: replace current windowed query #13845
miketheman
merged 3 commits into
pypi:main
from
miketheman:miketheman/refactor-windowed-query
Jun 8, 2023
Conversation
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
19 tasks
18c086b
to
fa443cd
Compare
3c834ed
to
00fbb72
Compare
SQLAlchemy Wiki updated their suggested implementation circa 2020. The existing code raises this deprecation warning: ``` RemovedIn20Warning: The Query.from_self() method is considered legacy as of the 1.x series of SQLAlchemy and will be removed in 2.0. The new approach is to use the orm.aliased() construct in conjunction with a subquery. See the section "Selecting from the query itself as a subquery" in the 2.0 migration notes for an example. ``` Instead of trying to update the syntax, use their suggested query which emits the same behavior. Signed-off-by: Mike Fiedler <miketheman@gmail.com>
00fbb72
to
ad287f8
Compare
di
approved these changes
Jun 8, 2023
miketheman
added a commit
to miketheman/warehouse
that referenced
this pull request
Apr 9, 2024
The upstream wiki has been updated. This implements the desired changes. See: https://github.com/sqlalchemy/sqlalchemy/wiki/RangeQuery-and-WindowedRangeQuery One notable difference is that the column must be comparable/sortable with a `ge` operator, and the implementation of UUID doesn't appear to work. Use `.name` instead. Previously refactored in pypi#13845 Signed-off-by: Mike Fiedler <miketheman@gmail.com>
miketheman
added a commit
to miketheman/warehouse
that referenced
this pull request
Apr 9, 2024
The upstream wiki has been updated. This implements the desired changes. See: https://github.com/sqlalchemy/sqlalchemy/wiki/RangeQuery-and-WindowedRangeQuery One notable difference is that the column must be comparable/sortable with a `ge` operator, and the implementation of UUID doesn't appear to work. Use `.name` instead. Previously refactored in pypi#13845 Signed-off-by: Mike Fiedler <miketheman@gmail.com>
miketheman
added a commit
to miketheman/warehouse
that referenced
this pull request
Apr 9, 2024
The upstream wiki has been updated. This implements the desired changes. See: https://github.com/sqlalchemy/sqlalchemy/wiki/RangeQuery-and-WindowedRangeQuery One notable difference is that the column must be comparable/sortable with a `ge` operator, and the implementation of UUID doesn't appear to work. Use `.name` instead. Previously refactored in pypi#13845 Signed-off-by: Mike Fiedler <miketheman@gmail.com>
ewdurbin
pushed a commit
that referenced
this pull request
Apr 10, 2024
The upstream wiki has been updated. This implements the desired changes. See: https://github.com/sqlalchemy/sqlalchemy/wiki/RangeQuery-and-WindowedRangeQuery One notable difference is that the column must be comparable/sortable with a `ge` operator, and the implementation of UUID doesn't appear to work. Use `.name` instead. Previously refactored in #13845 Signed-off-by: Mike Fiedler <miketheman@gmail.com>
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.
SQLAlchemy Wiki updated their suggested implementation circa 2020.
https://github.com/sqlalchemy/sqlalchemy/wiki/RangeQuery-and-WindowedRangeQuery
The existing code raises this deprecation warning:
Instead of trying to update the syntax, use their suggested query which emits the same behavior.
This is used in one place only - the nightly
reindex()
task, so it's low risk.