Skip to content

SNOW-3121122: Meta: Support for SQLAlchemy 2.1 #652

Closed

Description

@Dev-iL

What is the current behavior?

snowflake-sqlalchemy cannot be imported when SQLAlchemy 2.1.0b1 is installed. Example issue:

>>> from snowflake import sqlalchemy 
Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    from snowflake import sqlalchemy
  File "/home/USER/repositories/snowflake-sqlalchemy/src/snowflake/sqlalchemy/__init__.py", line 30, in <module>
    from . import base, snowdialect  # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/USER/repositories/snowflake-sqlalchemy/src/snowflake/sqlalchemy/base.py", line 240, in <module>
    class SnowflakeORMSelectCompileState(context.ORMSelectCompileState):
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'sqlalchemy.orm.context' has no attribute 'ORMSelectCompileState'

What is the desired behavior?

  • Short term - ability to import snowflake-sqlalchemy when SQLAlchemy 2.1 is installed.
  • Long term - full support for SQLAlchemy 2.1.

How would this improve snowflake-connector-python?

Better flexibility for integration with other tools.

References, Other Background

Activity

  1. changed the title [-]Meta: Support for SQLAlchemy 2.1[/-] [+]SNOW-3121122: Meta: Support for SQLAlchemy 2.1[/+] on Feb 19, 2026
  2. sfc-gh-mraba commented on Mar 2, 2026

    @sfc-gh-mraba
    Collaborator

    Hi,
    The support for 2.1 is on a wait list.
    To experiment with 2.1 we suggest cloning the repo and installing the dialect from the repo pip install 'git+ssh://...'

  3. Dev-iL commented on Mar 2, 2026

    @Dev-iL
    ContributorAuthor

    Hi @sfc-gh-mraba,

    I am aware of the official plans (as discussed in #635). I created this issue per suggestion/request of @sfc-gh-mborins. The idea is to have an issue that tracks the progress of adding such support.

    While development of "official" support has not yet started, does it also mean the project isn't willing to accept patches adding "unofficial, use at your own risk" support?

  4. sfc-gh-jcieslak commented on Mar 10, 2026

    @sfc-gh-jcieslak
    Member

    Hey @Dev-iL,
    Sorry, I didn't look at this issue before looking at the PR. Yes, we do appreciate having a public issue that serves as a tracker for a given feature in the project.

    At the same time, even though we also value patches for these tracked items, we would prefer to integrate them later, once we are explicitly focused on adapting to newer SQLAlchemy versions. For now, our priority is addressing existing issues, open pull requests, and known inconsistencies in the project.

    Regardless of the current level of “official” support, this is a public library used by many people. Larger behavioral or compatibility changes should therefore be backed by an analysis that we currently lack for this particular change.

    If you would like to contribute, I’d highly recommend starting with a short conversation (here, in a GitHub discussion, via email, or via another communication channel) about areas that are still in scope to address now. That would help ensure any proposed changes align with our current focus and roadmap.

    In the future, we would like to improve this process by creating a public roadmap with entries per quarter and creating proper contributing guidelines for the community, but for now, we have to work around the lack of both.

  5. RobinMcCann commented on Sep 25, 2026

    @RobinMcCann

    Hi, SQLAlchemy 2.1.0 rolled out officially yesterday. Since the current release of snowflake-sqlalchemy does not support SQLAlchemy 2.1, I suggest capping the dependency version at < 2.1, to make the fact explicit and to prevent installing incompatible versions, especially since support for 2.1 is not a main priority right now.

  6. Jonblunt999 commented on Oct 7, 2026

    @Jonblunt999

    I understand that sqlalchemy versions earlier than 2.1 are not safe in free threading mode. I am not using that feature but I am trying to implement concurrent sub processes where the snowflake access is distributed across multiple interpreters.

    It appears that with sqlalchemy in the project code base sqlalchemy 21 is a gateway to these ambitions. I would hope unlocking python parallel features would rwnk high on your road map

  7. Dev-iL commented on Oct 24, 2026

    @Dev-iL
    ContributorAuthor

    Looks like support was added by 223f9d6

  8. sfc-gh-mraba commented on Oct 26, 2026

    @sfc-gh-mraba
    Collaborator
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions