You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/12/09 14:41:09 UTC
[GitHub] [airflow] eladkal commented on a change in pull request #20166: Fixed issue #18967 - Oracle check connection not working
eladkal commented on a change in pull request #20166:
URL: https://github.com/apache/airflow/pull/20166#discussion_r765853593
##########
File path: airflow/providers/oracle/hooks/oracle.py
##########
@@ -266,3 +266,16 @@ def bulk_insert_rows(
self.log.info('[%s] inserted %s rows', table, row_count)
cursor.close()
conn.close() # type: ignore[attr-defined]
+
+ def test_connection(self):
+ """Tests the connection by executing a select 1 from dual query"""
+ status, message = False, ''
+ try:
+ if self.get_first("select 1 from dual"):
+ status = True
+ message = 'Connection successfully tested'
+ except Exception as e:
+ status = False
+ message = str(e)
+
+ return status, message
Review comment:
```suggestion
return status, message
```
Remove white space to make static checks happy
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org