turbaszek commented on pull request #8805:
URL: https://github.com/apache/airflow/pull/8805#issuecomment-635363551


   @ashb currently proposed approach resolves the relation when creating a 
DagBag:
   ```python
   for task in dag.tasks:
       settings.policy(task)
       task.set_xcomargs_dependencies() # here
   ```
   
   The problem is that in such case
   ```python
   with DAG(dag_id='xcomargs_test_3', default_args={"start_date": 
datetime.today()}) as dag3:
       op1 = DummyOperator(task_id="op1")
       op2 = CustomOp(task_id="op2", field=op1.output)
   
   assert op1 in op2.upstream_list. # False
   ```
   op1 is not in upstream of op2 because the relation is not resolved (no 
dagbag created).
   Same happens with polices but those are not as important as relations.
   
   The metaclass approach would be more generic and would work always. A 
possible problem is breaking backward compatibility. Users may use custom meta 
in their operators and will have to upgrade. 


----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to