rawwar commented on code in PR #37297:
URL: https://github.com/apache/airflow/pull/37297#discussion_r1484897249
##########
airflow/models/taskinstance.py:
##########
@@ -450,7 +450,16 @@ def _execute_callable(context, **execute_callable_kwargs):
else:
xcom_value = None
if xcom_value is not None: # If the task returns a result, push an
XCom containing it.
- task_instance.xcom_push(key=XCOM_RETURN_KEY, value=xcom_value,
session=session)
+ if task_to_execute.multiple_outputs:
+ if not isinstance(xcom_value, Mapping):
+ raise AirflowException(
+ "The returned value from the task is not a Mapping.
The `multiple_outputs`"
+ "parameter is set to True, so the result has to be a
Mapping."
+ )
+ for key, value in xcom_value.items():
Review Comment:
Wondering if we should limit number of outputs here?
Not really sure if this will cause issues. But, what if one accidentally
returned so much data or maybe just a very large list of values. Would that
cause performance issues?
--
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]