potiuk commented on issue #19884:
URL: https://github.com/apache/airflow/issues/19884#issuecomment-982728834


   I am with @uranusjr on that one. I think there are a number of cases that we 
did not realise it might cause if we validate XCom structure at runtime. Python 
value is that while simple thing are nice, you can (if you want) tap into the 
power of metaclasses, dynamic attributes and the likes and even if we add 
runtime warnings, we are limiting ourselves to just the "obvious" cases. I can 
very easily imagine a case where an implementation of Operator would push to 
Xcom an object with different internal structure but dynamic get_atrs() that 
would make it works with specific structure. This is not verifiable at runtime 
almost by definition.
   
   However I think validating cross-operator xcoms type hints in such situation 
is possible (for example with PEP 484 and stub files). And since DAGs are 
Python, we shoudl be able to simply (when we implement it) run mypy on the DAGs 
and there type hints should help DAG writer to develop the DAG.


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