-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
DbApiHook.test_connection() does not work with Oracle db #18967
Comments
cc: @msumit |
first thanks. also i got that error message ORA-00923 |
ORA-00923 is FROM keyword not found where expected. Currently we are testing a database connection with |
For all Oracle Database's versions you can replace "select 1" with "select 1 from dual" dual is a logical table present in every oracle schema you're connecting to. Probably is a simpler implementation of the test. |
Surely for Oracle yes so this mean that you have to add oracle specific 'test_connection" method in https://github.com/apache/airflow/blob/main/airflow/providers/oracle/hooks/oracle.py to override "test_connection" in https://github.com/apache/airflow/blob/main/airflow/hooks/dbapi.py#L376 Would you @hkjang @gbonazzoli care to make a PR fixing it for Oracle Hook? Sounds super easy and since you already use Oracle it wll be easy for you to test the fix. |
Solution for issue apache#18967 In order to check Oracle connection, the "select 1" statement is wrong. It must be replaced by "select 1 from dual".
Hi, can i finish it @gbonazzoli ? |
Yes, you are welcome, very welcome !!! |
Apache Airflow version
2.2.0 (latest released)
Operating System
Ubuntu 20.04.3 LTS
Versions of Apache Airflow Providers
apache-airflow-providers-oracle==2.0.1
Deployment
Other
Deployment details
What happened
The title and screenshot are self explaining
What you expected to happen
To have a successful message similar to what I got with SQL Server.
How to reproduce
No response
Anything else
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: