Skip to content

feat(databricks): migrate ODBC connections to the native databricks:// URI - #44278

Open
eschutho wants to merge 5 commits into
masterfrom
sc-120996-databricks-odbc-migration
Open

eschutho wants to merge 5 commits into
masterfrom
sc-120996-databricks-odbc-migration

Conversation

@eschutho

@eschutho eschutho commented Sep 15, 2026 •

Copy link
Copy Markdown
Member

SUMMARY

Superset renders the dynamic connection form when the engine spec resolved from a database's URI defines a parameters_schema. Databricks connections on the legacy databricks+pyodbc driver resolve to DatabricksODBCEngineSpec, which has no parameters_schema, so they only ever expose the raw "SQLAlchemy URI" text field.

This adds an Alembic migration that rewrites existing databricks+pyodbc databases to the native databricks:// scheme, which resolves to DatabricksPythonConnectorEngineSpec (the "Databricks" spec with the dynamic form). It lands ODBC connections on the same target as #45843 (b8f3a2c91d64, which converts legacy databricks+connector:// URIs to databricks://), rather than on the databricks+connector scheme that revision migrates away from.

Why this is a safe, scheme-only swap. Matching b8f3a2c91d64, only the URI prefix is rewritten; everything after the scheme is kept byte-for-byte:

databricks+pyodbc://token:<access_token>@<host>:<port>/<database>[?...]
databricks://token:<access_token>@<host>:<port>/<database>[?...]

The native spec reads the URI path as the default schema and takes http_path, catalog and schema from either the query string or extra.engine_params.connect_args. ODBC connections keep these settings in one of those two places, so the engine_params shape carries over unchanged.

ODBC → databricks:// field mapping

Field ODBC (databricks+pyodbc) native (databricks://, DatabricksPythonConnectorEngineSpec) Change
access token URL password (token:<pat>@) URL password none
host / port URL host / port URL host / port none
database URL path (/<database>) URL path, read as default schema none
http_path connect_args.http_path or ?http_path= same (both read) none
catalog / schema connect_args same (both read) none
other query params (e.g. ssl=1) URL query URL query none
ODBC-only connect args (driver_path) connect_args left in place; the Databricks SQL connector accepts and ignores unknown kwargs none
scheme databricks+pyodbc databricks rewritten

encrypted_extra and the encrypted password column are never read or written.

Rollback

upgrade() writes a marker (migrated_from_databricks_odbc: {"revision": "a3f5c9e21b84", "database_id": <id>}) into each migrated row's extra. downgrade() restores the exact databricks+pyodbc URI only for databricks:// rows whose marker matches this revision and that row's id, then strips it. Native databricks:// connections, rows converted by b8f3a2c91d64 (which carry that revision's own marker), and connections whose extra was copied from a migrated row are never touched. Rows with malformed extra are logged and skipped in both directions. Both directions are idempotent.

TESTING INSTRUCTIONS

  • pytest tests/unit_tests/migrations/test_migrate_databricks_odbc_to_native_uri.py (17 tests: scheme-swap helper including ?http_path= URIs, upgrade touches only ODBC rows, native and legacy-connector rows untouched, driver_path connect args preserved, idempotency, row-bound marker protection on downgrade, malformed extra, full round trip).
  • superset db heads resolves to the single head a3f5c9e21b84.
  • Real SQLite metadata DB: seeded databricks+pyodbc, databricks+connector and native databricks:// rows at f72b6e9c104a, then ran superset db upgrade (ODBC → databricks:// via this revision; legacy connector → databricks:// via b8f3a2c91d64) and superset db downgrade f72b6e9c104a. All rows came back byte-identical.
  • Manual: create a database with databricks+pyodbc://token:<pat>@host:443/default and http_path in Extra → engine_params.connect_args; run superset db upgrade. The connection should resolve to the "Databricks" spec, and the edit modal should show the dynamic form with http_path populated. Run superset db downgrade; the URI should revert to databricks+pyodbc and the marker should be gone.

ADDITIONAL INFORMATION

  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided (touches only databricks+pyodbc rows — ~11 fleet-wide; paginated update; no schema/DDL change, no downtime)

🤖 Generated with Claude Code

@bito-code-review

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

Copy link
Copy Markdown
Contributor

Code Review Agent Run #a347e0

Actionable Suggestions - 0
Additional Suggestions - 1
  • superset/migrations/versions/2026-09-15_00-00_a3f5c9e21b84_migrate_databricks_odbc_to_connector.py - 1
    • Round-trip extra fidelity · Line 145-145
      When a migrated connection's original `extra` was `"{}"`, upgrade turns it into `{"migrated_from_databricks_odbc": true}` and downgrade pops the marker leaving `{}` (falsy), so this writes `None` instead of `"{}"`. Functionally equivalent (`get_extra_params` returns `{}` for both), but it contradicts the docstring's "round trip is exact" claim. Consider `json.dumps(extra)` unconditionally.
Review Details
  • Files reviewed - 2 · Commit Range: a09f0b1..a09f0b1
    • superset/migrations/versions/2026-09-15_00-00_a3f5c9e21b84_migrate_databricks_odbc_to_connector.py
    • tests/unit_tests/migrations/test_migrate_databricks_odbc_to_connector.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 an incremental AI Review.

  • /review full - 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 risk:db-migration PRs that require a DB migration preset-io labels Sep 15, 2026
@codecov

codecov Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.35%. Comparing base (d7fa8b6) to head (080732f).
⚠️ Report is 206 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #44278      +/-   ##
==========================================
+ Coverage   85.23%   85.35%   +0.12%     
==========================================
  Files        3084     3095      +11     
  Lines      211515   213333    +1818     
  Branches    49864    50135     +271     
==========================================
+ Hits       180279   182094    +1815     
+ Misses      27835    27823      -12     
- Partials     3401     3416      +15     
Flag Coverage Δ
hive 33.99% <ø> (-0.07%) ⬇️
mysql 51.66% <ø> (-0.16%) ⬇️
postgres 51.69% <ø> (-0.16%) ⬇️
presto 35.68% <ø> (-0.03%) ⬇️
python 88.30% <ø> (+0.18%) ⬆️
sqlite 51.37% <ø> (-0.16%) ⬇️
unit 83.58% <ø> (+0.31%) ⬆️

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.

@github-actions

Copy link
Copy Markdown
Contributor

🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️❗ @eschutho Your base branch master has also updated superset/migrations.

Please consider rebasing your branch and resolving potential db migration conflicts.

3 similar comments
@github-actions

Copy link
Copy Markdown
Contributor

🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️❗ @eschutho Your base branch master has also updated superset/migrations.

Please consider rebasing your branch and resolving potential db migration conflicts.

@github-actions

Copy link
Copy Markdown
Contributor

🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️❗ @eschutho Your base branch master has also updated superset/migrations.

Please consider rebasing your branch and resolving potential db migration conflicts.

@github-actions

Copy link
Copy Markdown
Contributor

🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️ 🙅‍♂️❗ @eschutho Your base branch master has also updated superset/migrations.

Please consider rebasing your branch and resolving potential db migration conflicts.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Possible DB migration conflict

@eschutho the base branch master picked up a new database migration under superset/migrations/ after this PR was opened, and this PR adds or modifies migration files too. Alembic migrations form a single linear chain, so if both branch off the same parent revision, merging this PR as-is could leave the migration history with two heads instead of one, which makes superset db upgrade fail with Multiple head revisions are present.

To check and, if needed, fix this:

  1. Rebase this branch onto the latest master.
  2. Run superset db heads. If it lists more than one revision, you have a conflict.
  3. In your new migration's script, update down_revision (and the Revises comment) to point at the other head instead, so the chain has a single head again.

See Merging DB Migrations in the contributing guide for a worked example.

2 similar comments
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

⚠️ Possible DB migration conflict

@eschutho the base branch master picked up a new database migration under superset/migrations/ after this PR was opened, and this PR adds or modifies migration files too. Alembic migrations form a single linear chain, so if both branch off the same parent revision, merging this PR as-is could leave the migration history with two heads instead of one, which makes superset db upgrade fail with Multiple head revisions are present.

To check and, if needed, fix this:

  1. Rebase this branch onto the latest master.
  2. Run superset db heads. If it lists more than one revision, you have a conflict.
  3. In your new migration's script, update down_revision (and the Revises comment) to point at the other head instead, so the chain has a single head again.

See Merging DB Migrations in the contributing guide for a worked example.

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

⚠️ Possible DB migration conflict

@eschutho the base branch master picked up a new database migration under superset/migrations/ after this PR was opened, and this PR adds or modifies migration files too. Alembic migrations form a single linear chain, so if both branch off the same parent revision, merging this PR as-is could leave the migration history with two heads instead of one, which makes superset db upgrade fail with Multiple head revisions are present.

To check and, if needed, fix this:

  1. Rebase this branch onto the latest master.
  2. Run superset db heads. If it lists more than one revision, you have a conflict.
  3. In your new migration's script, update down_revision (and the Revises comment) to point at the other head instead, so the chain has a single head again.

See Merging DB Migrations in the contributing guide for a worked example.

@eschutho
eschutho force-pushed the sc-120996-databricks-odbc-migration branch from a09f0b1 to 6903831 Compare October 5, 2026 22:03
@codeant-ai-for-open-source

codeant-ai-for-open-source Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

CodeAnt  CodeAnt PR Risk

🟢  Low Risk

  • The PR appears safe to merge; a retry processes only remaining ODBC URIs, and each row’s URI and marker are updated together.
  • Downgrade requires an exact revision-and-row marker match, protecting native connections and copied markers.

Assessed commit: a4de8dce7fe0

@bito-code-review

bito-code-review Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #4b6b68

Actionable Suggestions - 0
Additional Suggestions - 2
  • superset/migrations/versions/2026-09-15_00-00_a3f5c9e21b84_migrate_databricks_odbc_to_connector.py - 2
    • Migration aborts on malformed extra · Line 105-105
      `_load_extra` raises `ValueError` on a non-dict `extra`, aborting the whole migration. Because `paginated_update` commits each batch, one malformed row mid-way leaves a partially-applied migration (earlier rows already swapped, later rows untouched). Consider logging and skipping the offending row so the migration completes and can be re-run idempotently.
    • Downgrade collapses empty extra to NULL · Line 145-145
      When the marker is the only key in `extra`, `extra.pop(MIGRATION_MARKER)` leaves `{}`, which is falsy, so `database.extra` is set to `None`. This contradicts the docstring's "round trip is exact" claim for connections whose `extra` was `"{}"` (or NULL). Use `json.dumps(extra)` unconditionally to preserve the empty object.
Review Details
  • Files reviewed - 2 · Commit Range: 6903831..6903831
    • superset/migrations/versions/2026-09-15_00-00_a3f5c9e21b84_migrate_databricks_odbc_to_connector.py
    • tests/unit_tests/migrations/test_migrate_databricks_odbc_to_connector.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 an incremental AI Review.

  • /review full - 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 commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

⚠️ Possible DB migration conflict

@eschutho the base branch master picked up a new database migration under superset/migrations/ after this PR was opened, and this PR adds or modifies migration files too. Alembic migrations form a single linear chain, so if both branch off the same parent revision, merging this PR as-is could leave the migration history with two heads instead of one, which makes superset db upgrade fail with Multiple head revisions are present.

To check and, if needed, fix this:

  1. Rebase this branch onto the latest master.
  2. Run superset db heads. If it lists more than one revision, you have a conflict.
  3. In your new migration's script, update down_revision (and the Revises comment) to point at the other head instead, so the chain has a single head again.

See Merging DB Migrations in the contributing guide for a worked example.

2 similar comments
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

⚠️ Possible DB migration conflict

@eschutho the base branch master picked up a new database migration under superset/migrations/ after this PR was opened, and this PR adds or modifies migration files too. Alembic migrations form a single linear chain, so if both branch off the same parent revision, merging this PR as-is could leave the migration history with two heads instead of one, which makes superset db upgrade fail with Multiple head revisions are present.

To check and, if needed, fix this:

  1. Rebase this branch onto the latest master.
  2. Run superset db heads. If it lists more than one revision, you have a conflict.
  3. In your new migration's script, update down_revision (and the Revises comment) to point at the other head instead, so the chain has a single head again.

See Merging DB Migrations in the contributing guide for a worked example.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Possible DB migration conflict

@eschutho the base branch master picked up a new database migration under superset/migrations/ after this PR was opened, and this PR adds or modifies migration files too. Alembic migrations form a single linear chain, so if both branch off the same parent revision, merging this PR as-is could leave the migration history with two heads instead of one, which makes superset db upgrade fail with Multiple head revisions are present.

To check and, if needed, fix this:

  1. Rebase this branch onto the latest master.
  2. Run superset db heads. If it lists more than one revision, you have a conflict.
  3. In your new migration's script, update down_revision (and the Revises comment) to point at the other head instead, so the chain has a single head again.

See Merging DB Migrations in the contributing guide for a worked example.

@rusackas

Copy link
Copy Markdown
Member

Thanks @eschutho, the scheme-only swap with the marker for a clean downgrade looks solid to me. One thing before I approve though. master has picked up more migrations, and down_revision here still points at 884a2115ebd3, which would leave two heads. Could you rebase and repoint it at the current head?

Codeant's two threads are still open too, so I'd love for you to assess and address or resolve those before this gets merged. Holler if you want a hand with the rebase.

@eschutho
eschutho force-pushed the sc-120996-databricks-odbc-migration branch from 6903831 to fb751e8 Compare October 13, 2026 17:22
@netlify

netlify Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit a4de8dc
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6af5e213ba583f786de1e890
😎 Deploy Preview https://deploy-preview-44278--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@eschutho
eschutho requested a review from rusackas October 13, 2026 18:04
@eschutho

Copy link
Copy Markdown
Member Author

@rusackas thanks for the review. Updated:

  • Rebased onto master and repointed the migration's down_revision to master's current head, c179af013f48, so the graph has a single head again. enforce-single-migration-head and Check DB migration conflict both pass.
  • Partial-run safety: upgrade and downgrade log and skip any connection whose extra is not a valid JSON object instead of aborting partway through a batched run. Each migrated row gets its new URI and marker together, so a run that stops partway is safe to re-run.
  • Scoped downgrade: the marker records this revision and the row's id, and downgrade only reverts connector-driver rows whose marker matches both. A connection whose extra was copied from a migrated one keeps its connector driver.

Both review threads are resolved, and the new cases are covered in tests/unit_tests/migrations/test_migrate_databricks_odbc_to_connector.py.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Possible DB migration conflict

@eschutho the base branch master picked up a new database migration under superset/migrations/ after this PR was opened, and this PR adds or modifies migration files too. Alembic migrations form a single linear chain, so if both branch off the same parent revision, merging this PR as-is could leave the migration history with two heads instead of one, which makes superset db upgrade fail with Multiple head revisions are present.

To check and, if needed, fix this:

  1. Rebase this branch onto the latest master.
  2. Run superset db heads. If it lists more than one revision, you have a conflict.
  3. In your new migration's script, update down_revision (and the Revises comment) to point at the other head instead, so the chain has a single head again.

See Merging DB Migrations in the contributing guide for a worked example.

2 similar comments
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Possible DB migration conflict

@eschutho the base branch master picked up a new database migration under superset/migrations/ after this PR was opened, and this PR adds or modifies migration files too. Alembic migrations form a single linear chain, so if both branch off the same parent revision, merging this PR as-is could leave the migration history with two heads instead of one, which makes superset db upgrade fail with Multiple head revisions are present.

To check and, if needed, fix this:

  1. Rebase this branch onto the latest master.
  2. Run superset db heads. If it lists more than one revision, you have a conflict.
  3. In your new migration's script, update down_revision (and the Revises comment) to point at the other head instead, so the chain has a single head again.

See Merging DB Migrations in the contributing guide for a worked example.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Possible DB migration conflict

@eschutho the base branch master picked up a new database migration under superset/migrations/ after this PR was opened, and this PR adds or modifies migration files too. Alembic migrations form a single linear chain, so if both branch off the same parent revision, merging this PR as-is could leave the migration history with two heads instead of one, which makes superset db upgrade fail with Multiple head revisions are present.

To check and, if needed, fix this:

  1. Rebase this branch onto the latest master.
  2. Run superset db heads. If it lists more than one revision, you have a conflict.
  3. In your new migration's script, update down_revision (and the Revises comment) to point at the other head instead, so the chain has a single head again.

See Merging DB Migrations in the contributing guide for a worked example.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Possible DB migration conflict

@eschutho the base branch master picked up a new database migration under superset/migrations/ after this PR was opened, and this PR adds or modifies migration files too. Alembic migrations form a single linear chain, so if both branch off the same parent revision, merging this PR as-is could leave the migration history with two heads instead of one, which makes superset db upgrade fail with Multiple head revisions are present.

To check and, if needed, fix this:

  1. Rebase this branch onto the latest master.
  2. Run superset db heads. If it lists more than one revision, you have a conflict.
  3. In your new migration's script, update down_revision (and the Revises comment) to point at the other head instead, so the chain has a single head again.

See Merging DB Migrations in the contributing guide for a worked example.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

⚠️ Possible DB migration conflict

@eschutho the base branch master picked up a new database migration under superset/migrations/ after this PR was opened, and this PR adds or modifies migration files too. Alembic migrations form a single linear chain, so if both branch off the same parent revision, merging this PR as-is could leave the migration history with two heads instead of one, which makes superset db upgrade fail with Multiple head revisions are present.

To check and, if needed, fix this:

  1. Rebase this branch onto the latest master.
  2. Run superset db heads. If it lists more than one revision, you have a conflict.
  3. In your new migration's script, update down_revision (and the Revises comment) to point at the other head instead, so the chain has a single head again.

See Merging DB Migrations in the contributing guide for a worked example.

@eschutho
eschutho force-pushed the sc-120996-databricks-odbc-migration branch from 5313092 to 6564069 Compare November 12, 2026 01:20
eschutho and others added 4 commits November 12, 2026 15:53
Databricks connections on the legacy `databricks+pyodbc` driver resolve to
`DatabricksODBCEngineSpec`, which has no `parameters_schema` and so only ever
renders the raw SQLAlchemy URI text field. The `databricks+connector` driver
resolves to `DatabricksNativeEngineSpec`, which defines a `parameters_schema`
and renders the dynamic connection form (epic sc-120993).

The two drivers share the same URL shape and both read http_path/catalog/schema
from `extra.engine_params.connect_args`, so migrating is a scheme-only driver
swap that preserves every credential and setting byte-for-byte. `upgrade`
records a marker in `extra` so `downgrade` reverts only the rows it migrated and
never touches natively-created connector connections; the round trip is exact
and the migration is idempotent.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Point the migration at the current migration head so the graph has a
single head again.

Upgrade and downgrade skip and log any connection whose extra is not a
valid JSON object instead of aborting partway through a batched run. The
URI and marker are written together per row, so a partial run is safe to
re-run.

The marker written on upgrade records this revision and the row id, and
downgrade only reverts rows whose marker matches both. A connection whose
extra was copied from a migrated one keeps its connector driver.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Point a3f5c9e21b84 at master's head b8f3a2c91d64 (migrate legacy connector
URIs) so the migration graph resolves to a single head again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Land databricks+pyodbc connections on the native databricks:// scheme
(DatabricksPythonConnectorEngineSpec) instead of databricks+connector, which
b8f3a2c91d64 migrates away from. Like that revision, only the URI prefix is
rewritten; extra keeps its engine_params shape and encrypted_extra and the
password column are never touched. Downgrade still restores the exact
databricks+pyodbc URI for rows carrying this revision's row-bound marker.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@eschutho
eschutho force-pushed the sc-120996-databricks-odbc-migration branch from 6564069 to a4de8dc Compare November 12, 2026 15:58
@eschutho eschutho changed the title feat(databricks): migrate ODBC connections to the connector driver feat(databricks): migrate ODBC connections to the native databricks:// URI Nov 12, 2026

@rusackas rusackas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @eschutho, appreciate the rebase and the thread cleanup. down_revision lines up with the current head on master, and landing these on databricks:// alongside #45843 makes sense to me.

One thing before approving, which I should have asked last time... this swaps the actual driver out from under ODBC connections, so a deployment that only has pyodbc set up would need the databricks extra installed before those connections work again after superset db upgrade, right? If so, I think this needs an UPDATING.md note like the one #45843 added for databricks+connector://. Otherwise LGTM!

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Possible DB migration conflict

@eschutho the base branch master picked up a new database migration under superset/migrations/ after this PR was opened, and this PR adds or modifies migration files too. Alembic migrations form a single linear chain, so if both branch off the same parent revision, merging this PR as-is could leave the migration history with two heads instead of one, which makes superset db upgrade fail with Multiple head revisions are present.

To check and, if needed, fix this:

  1. Rebase this branch onto the latest master.
  2. Run superset db heads. If it lists more than one revision, you have a conflict.
  3. In your new migration's script, update down_revision (and the Revises comment) to point at the other head instead, so the chain has a single head again.

See Merging DB Migrations in the contributing guide for a worked example.

@eschutho

Copy link
Copy Markdown
Member Author

Thanks @rusackas, yes, that's right: these connections move from pyodbc to the Databricks SQL connector, so deployments with only pyodbc need the databricks extra installed. Added an UPDATING.md entry in 080732f. down_revision was also re-checked against current master: superset db heads-equivalent parsing of master plus this migration gives a single head.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Possible DB migration conflict

@eschutho the base branch master picked up a new database migration under superset/migrations/ after this PR was opened, and this PR adds or modifies migration files too. Alembic migrations form a single linear chain, so if both branch off the same parent revision, merging this PR as-is could leave the migration history with two heads instead of one, which makes superset db upgrade fail with Multiple head revisions are present.

To check and, if needed, fix this:

  1. Rebase this branch onto the latest master.
  2. Run superset db heads. If it lists more than one revision, you have a conflict.
  3. In your new migration's script, update down_revision (and the Revises comment) to point at the other head instead, so the chain has a single head again.

See Merging DB Migrations in the contributing guide for a worked example.

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Possible DB migration conflict

@eschutho the base branch master picked up a new database migration under superset/migrations/ after this PR was opened, and this PR adds or modifies migration files too. Alembic migrations form a single linear chain, so if both branch off the same parent revision, merging this PR as-is could leave the migration history with two heads instead of one, which makes superset db upgrade fail with Multiple head revisions are present.

To check and, if needed, fix this:

  1. Rebase this branch onto the latest master.
  2. Run superset db heads. If it lists more than one revision, you have a conflict.
  3. In your new migration's script, update down_revision (and the Revises comment) to point at the other head instead, so the chain has a single head again.

See Merging DB Migrations in the contributing guide for a worked example.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Possible DB migration conflict

@eschutho the base branch master picked up a new database migration under superset/migrations/ after this PR was opened, and this PR adds or modifies migration files too. Alembic migrations form a single linear chain, so if both branch off the same parent revision, merging this PR as-is could leave the migration history with two heads instead of one, which makes superset db upgrade fail with Multiple head revisions are present.

To check and, if needed, fix this:

  1. Rebase this branch onto the latest master.
  2. Run superset db heads. If it lists more than one revision, you have a conflict.
  3. In your new migration's script, update down_revision (and the Revises comment) to point at the other head instead, so the chain has a single head again.

See Merging DB Migrations in the contributing guide for a worked example.

@rusackas rusackas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @eschutho, the UPDATING.md note covers it.

Sadly master picked up two more migrations since then (that's what the bot keeps flagging), and its head is now a7d29bc4e681 (add_chart_archive_scope), so this would end up with two heads. Mind pointing down_revision and the Revises: line at that one? Otherwise LGTM!

is safe to re-run.

Revision ID: a3f5c9e21b84
Revises: b8f3a2c91d64

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Revises: b8f3a2c91d64
Revises: a7d29bc4e681


# revision identifiers, used by Alembic.
revision = "a3f5c9e21b84"
down_revision = "b8f3a2c91d64"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
down_revision = "b8f3a2c91d64"
down_revision = "a7d29bc4e681"

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Possible DB migration conflict

@eschutho the base branch master picked up a new database migration under superset/migrations/ after this PR was opened, and this PR adds or modifies migration files too. Alembic migrations form a single linear chain, so if both branch off the same parent revision, merging this PR as-is could leave the migration history with two heads instead of one, which makes superset db upgrade fail with Multiple head revisions are present.

To check and, if needed, fix this:

  1. Rebase this branch onto the latest master.
  2. Run superset db heads. If it lists more than one revision, you have a conflict.
  3. In your new migration's script, update down_revision (and the Revises comment) to point at the other head instead, so the chain has a single head again.

See Merging DB Migrations in the contributing guide for a worked example.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preset-io risk:db-migration PRs that require a DB migration size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants