-
Notifications
You must be signed in to change notification settings - Fork 12
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
DM-34247: simplify dataset subquery logic and fix edge-case bugs #670
Commits on Apr 9, 2022
-
Refactor dataset subquery logic.
This used to be one massive method; now it's two medium-large methods and two very simple ones, and it's much easier to follow. This shouldn't change the query behavior at all, but it does collapse some UNION ALL constructs by merging their IN clauses when they are otherwise the same - the original code had an unnecessary distinction between CALIBRATION and other collection types (as well as some necessary distinctions, which this preserves).
Configuration menu - View commit details
-
Copy full SHA for 149c754 - Browse repository at this point
Copy the full SHA 149c754View commit details -
Configuration menu - View commit details
-
Copy full SHA for f70ba48 - Browse repository at this point
Copy the full SHA f70ba48View commit details -
Configuration menu - View commit details
-
Copy full SHA for b1a3d43 - Browse repository at this point
Copy the full SHA b1a3d43View commit details -
Belated changelog entry for DM-34328.
...which I just merged without a changelog entry.
Configuration menu - View commit details
-
Copy full SHA for 1e1b904 - Browse repository at this point
Copy the full SHA 1e1b904View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4c3fdf3 - Browse repository at this point
Copy the full SHA 4c3fdf3View commit details -
Configuration menu - View commit details
-
Copy full SHA for ec5e5a5 - Browse repository at this point
Copy the full SHA ec5e5a5View commit details -
Join in a dummy dataset subquery even when the query is doomed.
This prevents query construction from failing when someone queries for a skypix-dimension dataset type in collections where none exist. When the datasets do exist, we rely on the dataset table to bring in the skypix dimension, since those don't have tables of their own, and we need to do the same when the query is doomed to avoid triggering an exception about skypix dimensions not being directly joinable.
Configuration menu - View commit details
-
Copy full SHA for e6d6bd5 - Browse repository at this point
Copy the full SHA e6d6bd5View commit details
Commits on Apr 11, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 8e403ca - Browse repository at this point
Copy the full SHA 8e403caView commit details -
Move collection-type dispatch down to DatasetRecordStorage.select.
This fixes an edge-case bug involving mixed CALIBRATION/non-CALIBRATION searches introduced in the previous refactoring commit. This involves a small internal API change for DatasetRecordStorage - it now returns a SQLAlchemy object directly instead of one of our SimpleQuery instances, since it sometimes now returns a UNION.
Configuration menu - View commit details
-
Copy full SHA for fde3c66 - Browse repository at this point
Copy the full SHA fde3c66View commit details -
Minor typing fixes for Database.
These were revealed by installing the sqlalchemy-stubs package locally. That's something we should consider doing more broadly (e.g. in CI), as it revealed a lot more than just these, but it seems tangled up with migrating more fully to SQLAlchemy 2.0 APIs (there is a different stubs package for SQLAlchemy 2), and since that's not even fully released yet doing much more seems premature.
Configuration menu - View commit details
-
Copy full SHA for d168fa6 - Browse repository at this point
Copy the full SHA d168fa6View commit details