Repository navigation
Add databricks-sqlalchemy to the Databricks handler requirements - #9
Open
maharanay22 wants to merge 1 commit into
Open
maharanay22 wants to merge 1 commit into
maharanay22 wants to merge 1 commit into
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
Author
|
recheck |
databricks-sql-connector 4.x no longer ships the SQLAlchemy dialect, it moved to the separate databricks-sqlalchemy package. The handler still imports databricks.sqlalchemy, so after the bump to databricks-sql-connector 4.2.3 it failed to load with "No module named 'databricks.sqlalchemy'", and the unit tests for it were skipped as "Databricks handler not installed". Pin databricks-sqlalchemy 2.0.10, which supports connector 4.x and SQLAlchemy 2, and map it to the databricks module for deptry.
maharanay22
force-pushed
the
fix-databricks-sqlalchemy-dependency
branch
from
October 13, 2026 15:57
7d0c1b2 to
2d420d5
Compare
This branch has not been deployed
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.
Description
The Databricks integration can't be used on a fresh install. After
pip install "mindsdb[databricks]", the handler fails to load with:so
CREATE DATABASE ... WITH ENGINE = 'databricks'doesn't work andinformation_schema.handlersshows the import errorRepro: in a clean virtualenv, run
pip install "mindsdb[databricks]"from main, thenfrom mindsdb.integrations.handlers.databricks_handler import import_error; print(import_error)Root cause: the handler requirements were bumped to
databricks-sql-connector==4.2.3(#12334 in the old repo). Starting with 4.0, the connector no longer ships the SQLAlchemy dialect, which moved to the separatedatabricks-sqlalchemypackage.databricks_handler.pystill doesfrom databricks.sqlalchemy import DatabricksDialect. CI didn't catch it becausetest_databricks.pyskips the whole module when the import fails, so its 39 tests have been reported as skipped instead of failingThe fix pins
databricks-sqlalchemy==2.0.10in the handler requirements. That's the current release, and it supportsdatabricks-sql-connector>=4.0.1andsqlalchemy>=2.0.21, which matches this repo. Thedatabricksextra and the Docker images pick it up from the same file. I also mapped the package to thedatabricksmodule intests/scripts/check_requirements.py, the same waysnowflake-sqlalchemyis mapped, since deptry otherwise reports it as unused (DEP002)I left the skip-on-ImportError pattern in the test as it is, because most handler tests use it on purpose
I used an AI assistant to help investigate this and draft the change and tests, and I reviewed and tested it myself
Fixes: no issue to link, because issues are disabled on this repo. The bug is described above
Type of change
Verification Process
To ensure the changes are working as expected:
mindsdb/integrations/handlers/databricks_handler/requirements.txt,tests/unit/handlers/community_handlers/test_databricks.py.[databricks]from main in one and from this branch in the other, then import the handler and run the Databricks unit testsBefore (main):
After (this branch):
deptry with the same settings as
tests/scripts/check_requirements.pyreports no errors for the Databricks handler after the changeAdditional Media:
Checklist: