You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@airflow.task:Lazy imported from main Airflow module (real location airflow.decorators.task). Makes function an operator, but does not automatically assign it to a DAG (unless declared inside a DAG context)
@dag.task: As a partial function from DAG class. Task automatically assigned to DAG.
Use case / motivation
Enable easy transformation of python functions into PythonFunctionalOperators by making a decorator that takes a function and converts it into a PythonFunctionalOperator.
Stretch goals
Modify signature type hints (if any) to include XComArg for MyPy to not give issues. Example:
Description
Add simple way to wrap a function into a PythonFunctionalOperator.
PythonFunctionalOperator
. This can be used to set task dependencies. Ex:Example implemetation: https://github.com/casassg/corrent/blob/master/corrent/decorators.py
Ways to use it:
@airflow.task:
Lazy imported from main Airflow module (real location airflow.decorators.task). Makes function an operator, but does not automatically assign it to a DAG (unless declared inside a DAG context)@dag.task:
As a partial function from DAG class. Task automatically assigned to DAG.Use case / motivation
Stretch goals
XComArg
for MyPy to not give issues. Example:Related Issues
Blocked by: #8056
The text was updated successfully, but these errors were encountered: