Repository navigation
fix(migration): use non-deprecated sqlalchemy.orm.declarative_base - #42080
Conversation
The strip_metricsqlexpressions migration imported declarative_base from the deprecated sqlalchemy.ext.declarative path; pytest.ini promotes that deprecation warning to an error, breaking unit-test collection on the current Python matrix.
Code Review Agent Run #e33f3eActionable 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 #42080 +/- ##
==========================================
+ Coverage 64.49% 65.06% +0.56%
==========================================
Files 2747 2747
Lines 153843 153847 +4
Branches 35268 35269 +1
==========================================
+ Hits 99221 100096 +875
+ Misses 52712 51840 -872
- Partials 1910 1911 +1
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:
|
SUMMARY
#41591's migration importeddeclarative_basefrom the deprecatedsqlalchemy.ext.declarativepath.pytest.inipromotes that exact deprecation (declarative_base() is now available as sqlalchemy.orm.declarative_base()) to an error, so the full--cache-clearunit-test run dies at collection on the current Python matrix — blocking CI on every PR. This mirrors the sweep already done in#41981, which this migration (branched earlier) missed.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A — CI-only fix.
TESTING INSTRUCTIONS
pytest tests/unit_tests/migrations/test_strip_metricsqlexpressions_from_ag_grid_params.py— collects and passes (previously errored at collection under thedeclarative_basewarning filter).ADDITIONAL INFORMATION
Backwards-compatible: identical runtime behavior; only the import source changes to the non-deprecated
sqlalchemy.orm.declarative_base.