-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Making mssql
provider to support only mssql+pymssql
dialect
#39586
Comments
@Taragolis , requesting your comments on this. I was working on updating |
It looks like a small code change? If so it's better to simply raise PR we can have the discussion on the PR itself |
@rawwar Would you still like to work on this issue? |
I've already fixed this issue in PR 40669. I've tested it with JdbcHook and OdbcHook on multiple databases and also with MsSqlHook and all works fine. You can also define the 'sqlalchemy_scheme' parameter in the extra field of the Connection when using JdbcHook so SQLAlchemy get's the correct dialect instead of the 'jdbc' protocol value. |
Thanks @dabla , I'll assign this issue on you then. |
We could "remove" that property in MsSqlHook, but we for example are actually using is as we have installed multiple drivers (pymssql/odbc/jdbc/...) to access multiple databases. Indeed the 'sqlalchemy_scheme' schould be documented, especially in the case of the JdbcHook are there it is required to define it if you want to use the sqlalchemy engine. Maybe we should generalize that property and move it to the DbApiHook, as this code is duplicated in MsSqlHook and OdbcHook. |
As PR40669 has been closed I think this one can also be closed? |
Description
Currently, we allow users to pass dialect via
sqlalchemy_scheme
extra field of themssql
connections.airflow/airflow/providers/microsoft/mssql/hooks/mssql.py
Line 80 in 3873b09
I am proposing to remove this field as it is not possible to support multiple dialects without installing the relevant dialect driver. Also, the documentation page does not even mention about
sqlalchemy_scheme
or the possibility of using other dialects.Use case/motivation
Supporting multiple dialects requires the installation of multiple drivers. Since we only install
pymssql
, this allows the usage of themssql+pymssql
dialect alone and not others.I am also interested in updating the documentation to reflect this.
Related issues
No response
Are you willing to submit a PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: