kazanzhy commented on code in PR #23971:
URL: https://github.com/apache/airflow/pull/23971#discussion_r921120840
##########
airflow/providers/common/sql/hooks/sql.py:
##########
@@ -213,14 +243,13 @@ def run(self, sql, autocommit=False, parameters=None,
handler=None):
before executing the query.
:param parameters: The parameters to render the SQL query with.
:param handler: The result handler which is called with the result of
each statement.
- :return: query results if handler was provided.
+ :return: return only result of the LAST SQL expression if handler was
provided.
"""
- scalar = isinstance(sql, str)
- if scalar:
- sql = [sql]
+ if isinstance(sql, str):
+ sql = self.maybe_split_sql_string(sql)
Review Comment:
That's a very good remark.
I'm returning the previous behavior. I moved to DbApiHook a
`_strip_sql_string` from trino/presto and `_split_sql_string` from
Databricks/Exasol. Snowflake still uses its own splitter
--
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]