Why isn't there an OdbcOperator? #32047
-
DescriptionWe would like to have an OdbcOperator so that we can easily execute SQL statements without the need of defining methods in our DAG using the OdbcHook. Use case/motivationWe would like to have an OdbcOperator, we're already writing our own one as a POC based on the BaseSQLOperator and also willing to contribute it to the Airflow project, unless there is an alternative or are there any plans to support OdbcHooks right off the SQLOperator? Related issuesNo response Are you willing to submit a PR?
Code of Conduct
|
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
|
Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval. |
Beta Was this translation helpful? Give feedback.
-
|
hi @dabla, There is an airflow.providers.common.sql.operators.sql.SQLExecuteQueryOperator which extends the This I believe will allow you to run SQL queries for ODBC type connections too. Can you please use that and check if something is missing there? |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for your swift answer :) I just found out the same thing while going through the source code (I saw the deprecation message in the JdbcOperator) stating the same you're saying. Will try using the SQLExecuteQueryOperator and keep you posted. |
Beta Was this translation helpful? Give feedback.
-
|
I think @pankajkoti is perfect answer. I converted this to a discussion where it can be continued. Generelly note for the future, any issue that you start with a question mark should start as a GitHub discussion not an issue. When you open an issue you get informed about it clearly in the template (including a link to follow to create a new discussion entry). It would be great to read and follow those guidelines next time you have a question @dabla. |
Beta Was this translation helpful? Give feedback.
-
|
And some comment why - we try to manage our issues to some extent. Issue is usually something that we can track, measure and see where we can improve the project, discussions are more for help/answering the questions and general discussion about the project. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks again for your help ! |
Beta Was this translation helpful? Give feedback.
hi @dabla,
There is an airflow.providers.common.sql.operators.sql.SQLExecuteQueryOperator which extends the
BaseSQLOperatorand is the recommended way for running SQL queries.Docs link: https://airflow.apache.org/docs/apache-airflow-providers-common-sql/stable/operators.html#execute-sql-query
This I believe will allow you to run SQL queries for ODBC type connections too. Can you please use that and check if something is missing there?