Make SQA store SQLAlchemy 2.0-compatible#5201
Open
LeoMoonStar wants to merge 1 commit into
Open
Conversation
Summary:
The OSS Ax SQA store has a hard guard in with_db_settings_base.py that raises IncompatibleDependencyVersion when SQLAlchemy major > 1, disabling SQL storage entirely. This blocks SA 2.0 adoption (T163607006) and Python 3.13/3.14 (which auto-select SA 2.0.48 from third-party). Two additional SA 2.0 incompatibilities exist in OSS: defer("col_name") in load.py and reduced_state.py, which SA 2.0 rejects in favor of class-bound attribute references.
This diff removes the guard and converts the string-based loader options to attribute references. Adds a dual-version Buck test target tests_sa2 via constraint_overrides plus a self-proving TestSQLAlchemyDualVersionCompat class so each target proves its constraint took effect (EXPECTED_SA_MAJOR env var asserted at runtime).
Differential Revision: D104875017
|
@LeoMoonStar has exported this pull request. If you are a Meta employee, you can view the originating Diff in D104875017. |
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.
The Ax SQA store has a hard guard in
with_db_settings_base.pythat raisesIncompatibleDependencyVersionwhen SQLAlchemy major > 1, disabling SQL storage entirely. This blocks SA 2.0 adoption and Python 3.13/3.14, which install SA 2.x by default. Two additional SA 2.0 incompatibilities exist:defer("col_name")inload.pyandreduced_state.py, which SA 2.0 rejects in favor of class-bound attribute references.This change removes the guard and converts the string-based loader options to attribute references. Adds
TestSQLAlchemyDualVersionCompatwhich(a) asserts
DBSettingsresolves to the real class type whenever SQLAlchemy is importable (proving the guard is gone) and(b) optionally asserts the runtime SQLAlchemy
major matches an
EXPECTED_SA_MAJORenv var, for CI matrices that pin a specific SQLAlchemy version.