RehanAhmad25 commented on issue #74432: URL: https://github.com/apache/airflow/issues/74432#issuecomment-6066476850
Hey @RaphCodec , I'd like to take this one if that's okay. Two things I checked first: - This doesn't look blocked on SQLAlchemy anymore. #73865 only excluded 2.1.0 (the sdist had a duplicate mssql-pymssql extra that uv couldn't parse). On main, airflow-core allows sqlalchemy>=2.0.50 with no exclusion, and today's constraints-main resolves SQLAlchemy 2.1.3 together with pymssql 2.4.2. - MsSqlHook already reads sqlalchemy_scheme from the constructor or the connection extra, so the SQLAlchemy engine side should work with the mssql+mssqlpython scheme on 2.1+. The hardwired part is the raw DBAPI path: get_conn() calls pymssql.connect(...), set_autocommit/get_autocommit use pymssql specific calls, pymssql is imported at module level, and it's a hard dependency of the provider. What I'd propose: 1. Add a driver option on the connection extra (pymssql or mssql_python). pymssql stays the default so nothing changes for existing users. 2. Make the pymssql import lazy and add mssql-python as an optional extra of the provider. 3. Add an mssql_python branch in get_conn() and the autocommit methods. It would build mssql-python's connection string from the Airflow connection fields, including the Entra auth keywords. 4. Unit tests with both drivers mocked, plus docs. Does this shape work for you? In particular, connection extra vs a new hook argument for picking the driver, and optional extra vs a second regular dependency. Happy to change either before I write any code. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
