-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Closed
Labels
AIP-31Task Flow API for nicer DAG definitionTask Flow API for nicer DAG definitionkind:featureFeature RequestsFeature Requests
Description
Description
Operator that enables wrapping a python function and call it as a function in the DAG.
- Should have
__call__method that capturesargsandkwargsand sets them asop_argsandop_kwargs.
Use case / motivation
Base class needed to implement functions wrapped in operators. See Python function decorator in AIP-31
Example implementation: https://github.com/casassg/corrent/blob/master/corrent/operators.py
Stretch goal
- Add
copy(new_task_id:str)method that allows you to create a new PythonFunctionOperator from the previous operator and changing the task_id. This should make it easier to reuse functional operators in a DAG without affecting the constraint of having a unique ID. - Another option is to append a number in the function if no
new_task_idis set by looking in the DAG object for other operators with the same task_id.
match-gabeflores and hemanth-reddy-k
Metadata
Metadata
Assignees
Labels
AIP-31Task Flow API for nicer DAG definitionTask Flow API for nicer DAG definitionkind:featureFeature RequestsFeature Requests