potiuk commented on a change in pull request #15581:
URL: https://github.com/apache/airflow/pull/15581#discussion_r632301007
##########
File path: airflow/providers/oracle/operators/oracle.py
##########
@@ -62,4 +68,30 @@ 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(),
+ }
+
+ kwargs = {
+ "autocommit": self.autocommit,
+ "parameters": self.parameters,
+ }
+
+ # For backwards compatibility, if the hook implementation does not
Review comment:
Cool. But... We do not need backwards compatibily any more :). We've
just made a decision that the next wave of providers will be Airflow 2.1+
compatible and we are *just about* to release 2.1 (this was due to removal of
@apply_defaults - see #15667 ). So feel free to rebase and remove the last
commit and I am happy to merge it before 2.1
--
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]