Repository navigation
fix(migration): use sqlalchemy.orm.declarative_base to avoid MovedIn20Warning - #42056
Conversation
…0Warning Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Code Review Agent Run #42e52eActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #42056 +/- ##
==========================================
+ Coverage 64.49% 65.06% +0.56%
==========================================
Files 2747 2747
Lines 153843 153843
Branches 35268 35268
==========================================
+ Hits 99221 100095 +874
+ Misses 52712 51838 -874
Partials 1910 1910
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…0Warning (apache#42056) Co-authored-by: Matt Fitzgerald <[email protected]> Co-authored-by: Claude Sonnet 4.6 <[email protected]>
SUMMARY
The migration added in #41591 imported
declarative_basefrom the deprecatedsqlalchemy.ext.declarativepath. SQLAlchemy 1.4 moved it tosqlalchemy.orm.declarative_baseand emitsMovedIn20Warningon the old path.The migration file is imported at pytest collection time by its unit test, which means any test run with warnings-as-errors fails at collection — blocking unrelated PRs (e.g. #42052).
One-line fix: update the import to the canonical
sqlalchemy.ormpath.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A
TESTING INSTRUCTIONS
pytest tests/unit_tests/migrations/test_strip_metricsqlexpressions_from_ag_grid_params.py— should pass with noMovedIn20Warningsqlalchemy.exc.MovedIn20Warningat collection timeADDITIONAL INFORMATION