Yanislava commented on code in PR #75967:
URL: https://github.com/apache/airflow/pull/75967#discussion_r4505242439
##########
providers/vertica/src/airflow/providers/vertica/hooks/vertica.py:
##########
@@ -205,8 +234,20 @@ def run(
"""
Overwrite the common sql run.
- Will automatically replace fetch_all_handler by
vertica_fetch_all_handler.
+ vertica-python only reports an error raised by a statement once its
result set is reached, so
+ every result set is consumed after each executed statement, whatever
the handler is (including
+ when no handler is passed). Otherwise a failing statement in a
multi-statement query could be
+ silently ignored.
"""
- if handler == fetch_all_handler:
+ if handler is None:
+ DbApiHook.run(
+ self, sql, autocommit, parameters, _drain_result_sets,
split_statements, return_last
+ )
+ # Without a handler, DbApiHook.run does not collect descriptions;
keep that behaviour.
+ self.descriptions = []
+ return None
+ if handler is fetch_all_handler:
Review Comment:
Done: every handler is wrapped the same way now, vertica_fetch_all_handler
is kept only as a public name for backward compatibility, and the class
docstring is updated.
--
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]