bdsoha commented on code in PR #27319:
URL: https://github.com/apache/airflow/pull/27319#discussion_r1010853681
##########
airflow/providers/oracle/operators/oracle.py:
##########
@@ -93,4 +94,10 @@ def __init__(
def execute(self, context: Context):
self.log.info("Executing: %s", self.procedure)
hook = OracleHook(oracle_conn_id=self.oracle_conn_id)
- return hook.callproc(self.procedure, autocommit=True,
parameters=self.parameters)
+ ti=context.get('task_instance')
+ try:
+ return hook.callproc(self.procedure, autocommit=True,
parameters=self.parameters)
+ except oracledb.DatabaseError as e:
+ code, mesg = e.args[0].message[:-1].split(': ', 1)
+ ti.xcom_push(key='ORA', value=str(code.split('-')[1]))
Review Comment:
IMO, there is a difference between *data* returned from an operator and
*meta-data* describing the operator's execution. The `self.do_xcom_push`
controls the storing *(pushing)* of data returned by the logic of a given
operator and not *meta-data*.
@eladkal What do you think?
--
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]