potiuk commented on a change in pull request #15581:
URL: https://github.com/apache/airflow/pull/15581#discussion_r624499431



##########
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:
       We could do in one of the ways described here: 
https://stackoverflow.com/questions/11915032/get-keyword-arguments-for-function-python




-- 
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]


Reply via email to