malthe commented on a change in pull request #15581:
URL: https://github.com/apache/airflow/pull/15581#discussion_r624621992
##########
File path: airflow/providers/oracle/operators/oracle.py
##########
@@ -63,4 +68,25 @@ def __init__(
def execute(self, context) -> None:
self.log.info('Executing: %s', self.sql)
hook = OracleHook(oracle_conn_id=self.oracle_conn_id)
- hook.run(self.sql, autocommit=self.autocommit,
parameters=self.parameters)
+
+ def handler(cur):
+ bindvars = cur.bindvars
+
+ if isinstance(bindvars, list):
+ bindvars = [v.getvalue() for v in bindvars]
+ elif isinstance(bindvars, dict):
+ bindvars = {n: v.getvalue() for (n, v) in bindvars.items()}
+ else:
+ raise TypeError(bindvars)
+
+ return {
+ "bindvars": bindvars,
+ "rows": cur.fetchall(),
+ }
+
+ return hook.run(
Review comment:
@potiuk to some extent I feel that this is a big enough change either
way that perhaps a 2.1 target is not so bad – in how it'll actually fetch all
rows now and – given that `do_push_xcom` is set by default – pushed to Xcom.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]