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 2021/11/30 09:15:26 UTC

[GitHub] [airflow] hterik commented on issue #19884: Type hinted `@task` decorated functions to create typed XComs

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


   I don't think you have to rely on runtime type hints to provide such feature.
   
   As long as the types passed between tasks provide some kind of from_json and to_json functions, you can rely on normal mypy to provide the validation of `whats_a_baz(get_baz())` having correct return value vs input argument. Right now this is constrained by only allowing scalars or dicts to be returned from tasks. 
   Then inside airflow internals, the serialization (eg the *# could be inferred"* in example above) should be possible to do runtime without the type hints, by calling the from_json/to_json if the returned value has such functions. 


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