tatiana commented on code in PR #30943:
URL: https://github.com/apache/airflow/pull/30943#discussion_r1185918918


##########
tests/models/test_mappedoperator.py:
##########
@@ -57,6 +59,36 @@ def test_task_mapping_with_dag():
     assert mapped.downstream_list == [finish]
 
 
+def test_task_mapping_with_dag_and_list_of_pandas_dataframe(caplog):
+    caplog.set_level(logging.INFO)
+
+    class UnrenderableClass:
+        def __bool__(self):
+            raise ValueError("Similar to Pandas DataFrames, this class raises 
an exception.")
+
+    class CustomOperator(BaseOperator):
+        template_fields = ("arg",)
+
+        def __init__(self, arg, **kwargs):
+            super().__init__(**kwargs)
+            self.arg = arg
+
+        def execute(self, context: Context):
+            pass
+
+    with DAG("test-dag", start_date=DEFAULT_DATE) as dag:
+        task1 = CustomOperator(task_id="op1", arg=None)
+        unrenderable_values = [UnrenderableClass(), UnrenderableClass()]
+        mapped = 
CustomOperator.partial(task_id="task_2").expand(arg=unrenderable_values)
+        task1 >> mapped
+    dag.test()
+    assert caplog.text.count("task_2 ran successfully") == 2
+    assert (
+        "Unable to check if the value of type 'UnrenderableClass' is False for 
task 'task_2', field 'arg'"
+        in caplog.text
+    )
+

Review Comment:
   @jedcunningham just added a check that confirms we're still attempting to 
render the template!



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

Reply via email to