You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/09/03 14:34:55 UTC

[GitHub] [airflow] kaxil commented on a diff in pull request #26134: Remove `cattrs` from airflow.lineage

kaxil commented on code in PR #26134:
URL: https://github.com/apache/airflow/pull/26134#discussion_r962161250


##########
tests/lineage/test_lineage.py:
##########
@@ -118,6 +120,37 @@ def test_lineage_render(self, dag_maker):
         assert op1.inlets[0].url == f1s.format(DEFAULT_DATE)
         assert op1.outlets[0].url == f1s.format(DEFAULT_DATE)
 
+    def test_non_attr_outlet(self, dag_maker):
+        class A:
+            pass
+
+        a = A()
+
+        f3s = "/tmp/does_not_exist_3"
+        file3 = File(f3s)
+
+        with dag_maker(dag_id='test_prepare_lineage'):
+            op1 = EmptyOperator(
+                task_id='leave1',
+                outlets=[a, file3],
+            )
+            op2 = EmptyOperator(task_id='leave2', inlets='auto')
+
+            op1 >> op2
+
+        dag_run = dag_maker.create_dagrun(run_type=DagRunType.SCHEDULED)
+
+        ctx1 = Context({"ti": TI(task=op1, run_id=dag_run.run_id), "ds": DEFAULT_DATE})
+        ctx2 = Context({"ti": TI(task=op2, run_id=dag_run.run_id), "ds": DEFAULT_DATE})
+
+        # prepare with manual inlets and outlets
+        op1.pre_execute(ctx1)
+        op1.post_execute(ctx1)

Review Comment:
   ```suggestion
           op1.pre_execute(ctx1)
           assert op1.outlets == [a, file3]
           op1.post_execute(ctx1)
   ```



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org