turbaszek commented on a change in pull request #10349:
URL: https://github.com/apache/airflow/pull/10349#discussion_r471974397



##########
File path: airflow/operators/python.py
##########
@@ -249,6 +250,9 @@ def execute(self, context: Dict):
                                            f'multiple_outputs, found {key} 
({type(key)}) instead')
             for key, value in return_value.items():
                 self.xcom_push(context, key, value)
+        elif is_container(return_value):
+            for i, value in enumerate(return_value):
+                self.xcom_push(context, str(i), value)

Review comment:
       ```suggestion
                   self.xcom_push(context, f"return_value{i}", value)
   ```
   How about something more informative? 

##########
File path: airflow/operators/python.py
##########
@@ -249,6 +250,9 @@ def execute(self, context: Dict):
                                            f'multiple_outputs, found {key} 
({type(key)}) instead')
             for key, value in return_value.items():
                 self.xcom_push(context, key, value)
+        elif is_container(return_value):
+            for i, value in enumerate(return_value):
+                self.xcom_push(context, str(i), value)

Review comment:
       ```suggestion
                   self.xcom_push(context, f"return_value_{i}", value)
   ```
   How about something more informative? 




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