potiuk commented on code in PR #26944:
URL: https://github.com/apache/airflow/pull/26944#discussion_r1006268023
##########
airflow/providers/common/sql/hooks/sql.py:
##########
@@ -38,6 +41,35 @@ def fetch_all_handler(cursor) -> list[tuple] | None:
return None
+def fetch_one_handler(cursor) -> list[tuple] | None:
+ """Handler for DbApiHook.run() to return results"""
+ if cursor.description is not None:
+ return cursor.fetchone()
+ else:
+ return None
+
+
+def _backported_get_hook(connection, *, hook_params=None):
+ """Return hook based on conn_type
+ For supporting Airflow versions < 2.3, we backport "get_hook()" method.
This should be removed
+ when "apache-airflow-providers-slack" will depend on Airflow >= 2.3.
Review Comment:
Agree we cam remove it (and add apache-airflow >= 2.3
--
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]