Skip to content

Incompatibility with SQLAlchemy 2.0.0+ #443

@PApostol

Description

@PApostol

SQLAlchemy 2.0.0 has been released on the 26th of January 2023, and it's incompatible with PyHive for connections to Presto, Trino and Hive:

from sqlalchemy import create_engine
create_engine('presto://foo:bar@host')

# results in

  File "/some/path/pyhive/sqlalchemy_presto.py", line 16, in <module>
    from sqlalchemy.databases import mysql
ModuleNotFoundError: No module named 'sqlalchemy.databases'

Similarly,

from sqlalchemy import create_engine
create_engine('trino://foo:bar@host')

# results in

  File "/some/path/sqlalchemy/util/langhelpers.py", line 366, in load
    "Can't load plugin: %s:%s" % (self.group, name)
sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:trino

and

from sqlalchemy import create_engine
create_engine('hive://foo:bar@host')

# results in
  File "/some/path/pyhive/sqlalchemy_hive.py", line 16, in <module>
    from sqlalchemy import processors
ImportError: cannot import name 'processors' from 'sqlalchemy' (/some/path/sqlalchemy/__init__.py)

Pinning SQLAlchemy<2.0.0 resolves the issue.

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