镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Issues when using databricks-sql-connector==4.6.0 #77

Open

Description

@brain246

Hello there,

I am using databricks-sqlalchemy (2.0.10) in combination with alembic (1.8.4) in a CI/CD pipeline to automate schema migrations.

When our pipeline suddenly stopped working, i found out after some debugging, that alembic fails with an error message (see below) when using databricks-sql-connector==4.6.0. After pinning the sql connector to databricks-sql-connector==4.2.6 (the version it works with from my local machine), the migrations ran through again.

The corresponding part of my CI/CD pipeline log:

  File "/agent/_work/1/s/.venv/lib/python3.14/site-packages/databricks/sqlalchemy/base.py", line 382, in has_table
    self._describe_table_extended(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        connection=connection,
        ^^^^^^^^^^^^^^^^^^^^^^
    ...<2 lines>...
        schema_name=schema,
        ^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/agent/_work/1/s/.venv/lib/python3.14/site-packages/databricks/sqlalchemy/base.py", line 208, in _describe_table_extended
    fmt_result = _describe_table_extended_result_to_dict_list(result)
  File "/agent/_work/1/s/.venv/lib/python3.14/site-packages/databricks/sqlalchemy/_parse.py", line 40, in _describe_table_extended_result_to_dict_list
    for row in result.all():
               ~~~~~~~~~~^^
  File "/agent/_work/1/s/.venv/lib/python3.14/site-packages/sqlalchemy/engine/result.py", line 987, in all
    return self._allrows()
           ~~~~~~~~~~~~~^^
  File "lib/sqlalchemy/engine/_result_cy.py", line 366, in sqlalchemy.engine._result_cy.BaseResultInternal._allrows
  File "lib/sqlalchemy/engine/_result_cy.py", line 201, in sqlalchemy.engine._result_cy.BaseResultInternal._row_getter.many_rows_simple
  File "lib/sqlalchemy/engine/_row_cy.py", line 72, in sqlalchemy.engine._row_cy.BaseRow.__init__
TypeError: Expected tuple, got Row

Cheers,
Thomas

Activity

  1. henryhueske commented on Sep 28, 2026

    @henryhueske

    We are seeing a similar runtime failure when using databricks-sqlalchemy==2.0.10 with SQLAlchemy 2.1.x:

    TypeError: Expected tuple, got Row
    

    The failure occurs during Alembic/SQLAlchemy metadata inspection and prevents database migrations from running. It seems to be related with the SQLAlchemy versions 2.1.x, which were released recently. After pinning SQLAlchemy to the version 2.0.x, the issue disappear.

    Environment

    • Python: 3.12.14
    • SQLAlchemy: 2.1.x
    • databricks-sqlalchemy: 2.0.10
    • databricks-sql-connector: 4.6.0
    • Alembic: 1.20.0

    Request

    Please fix compatibility between databricks-sqlalchemy==2.0.10 and SQLAlchemy 2.1.x, or explicitly document and enforce the supported SQLAlchemy version range. Thanks!

  2. brain246 commented on Sep 30, 2026

    @brain246
    Author

    We are seeing a similar runtime failure when using databricks-sqlalchemy==2.0.10 with SQLAlchemy 2.1.x:

    TypeError: Expected tuple, got Row
    

    The failure occurs during Alembic/SQLAlchemy metadata inspection and prevents database migrations from running. It seems to be related with the SQLAlchemy versions 2.1.x, which were released recently. After pinning SQLAlchemy to the version 2.0.x, the issue disappear.

    Environment

    • Python: 3.12.14
    • SQLAlchemy: 2.1.x
    • databricks-sqlalchemy: 2.0.10
    • databricks-sql-connector: 4.6.0
    • Alembic: 1.20.0

    Request

    Please fix compatibility between databricks-sqlalchemy==2.0.10 and SQLAlchemy 2.1.x, or explicitly document and enforce the supported SQLAlchemy version range. Thanks!

    yeah, i just stumbled upon the issue with sqlalchemy 2.1.1 too. welcome to dependency hell ;)

  3. ovidiu-eremia commented on Oct 12, 2026

    @ovidiu-eremia

    @brain246 @henryhueske
    I think you were experiencing this bug:
    sqlalchemy/sqlalchemy#13634

    It was fixed with SQLAlchemy 2.1.3.
    It's not the fault of this Dbx dialect.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions