Skip to content

fix(migration): use non-deprecated sqlalchemy.orm.declarative_base - #42080

Merged
msyavuz merged 1 commit into
masterfrom
msyavuz/fix/migration-declarative-base
Jul 16, 2026
Merged

msyavuz merged 1 commit into
masterfrom
msyavuz/fix/migration-declarative-base

Conversation

@msyavuz

@msyavuz msyavuz commented Jul 15, 2026

Copy link
Copy Markdown
Member

SUMMARY

#41591's migration imported declarative_base from the deprecated sqlalchemy.ext.declarative path. pytest.ini promotes that exact deprecation (declarative_base() is now available as sqlalchemy.orm.declarative_base()) to an error, so the full --cache-clear unit-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.

-from sqlalchemy.ext.declarative import declarative_base
+from sqlalchemy.orm import declarative_base

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 the declarative_base warning filter).

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags: none
  • Changes UI
  • Includes DB Migration — edits an existing migration's import only; no schema/logic change
  • Introduces new feature or API
  • Removes existing feature or API

Backwards-compatible: identical runtime behavior; only the import source changes to the non-deprecated sqlalchemy.orm.declarative_base.

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.
@bito-code-review

bito-code-review Bot commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #e33f3e

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: cd1b145..cd1b145
    • superset/migrations/versions/2026-06-30_00-00_d24e6b0a9c7f_strip_metricsqlexpressions_from_ag_grid_params.py
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@github-actions github-actions Bot added the risk:db-migration PRs that require a DB migration label Jul 15, 2026
@codecov

codecov Bot commented Jul 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.06%. Comparing base (d68e84e) to head (cd1b145).
⚠️ Report is 11 commits behind head on master.

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     
Flag Coverage Δ
hive 39.05% <ø> (-0.01%) ⬇️
mysql 57.89% <ø> (-0.01%) ⬇️
postgres 57.94% <ø> (-0.01%) ⬇️
presto 41.04% <ø> (-0.01%) ⬇️
python 59.32% <ø> (+1.16%) ⬆️
sqlite 57.55% <ø> (-0.01%) ⬇️
unit 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@msyavuz
msyavuz merged commit 059f694 into master Jul 16, 2026
62 checks passed
@msyavuz
msyavuz deleted the msyavuz/fix/migration-declarative-base branch July 16, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:db-migration PRs that require a DB migration size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants