eladkal commented on code in PR #50143:
URL: https://github.com/apache/airflow/pull/50143#discussion_r2079067572
##########
providers/slack/src/airflow/providers/slack/transfers/base_sql_to_slack.py:
##########
@@ -70,15 +70,13 @@ def _get_hook(self) -> DbApiHook:
self.log.debug("Get connection for %s", self.sql_conn_id)
conn = BaseHook.get_connection(self.sql_conn_id)
hook = conn.get_hook(hook_params=self.sql_hook_params)
- if not callable(getattr(hook, "get_pandas_df", None)):
- raise AirflowException(
- "This hook is not supported. The hook class must have
get_pandas_df method."
- )
+ if not callable(getattr(hook, "get_df", None)):
+ raise AirflowException("This hook is not supported. The hook class
must have get_df method.")
return hook
def _get_query_results(self) -> pd.DataFrame:
sql_hook = self._get_hook()
self.log.info("Running SQL query: %s", self.sql)
- df = sql_hook.get_pandas_df(self.sql, parameters=self.parameters)
+ df = sql_hook.get_df(self.sql, parameters=self.parameters)
Review Comment:
not related to this PR but it's not clear how someone who uses the operator
can ask to use polars.
For example someone who use `SqlToSlackWebhookOperator`.
--
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]