Autodocument Airflow code with Sphinx and autodoc

Viewed 226

When documenting Airflow DAG using operator '>>' I get some errors on the dependencies between tasks. If I mock airflow operators then I receive the error that the operator '>>' does not exist between objects in python.

Is there any way to omit some lines of the code (the ones that I've create realtions) or avoid the exception?

I really want to avoid using set_downstream notation...

airflow.exceptions.AirflowException: Tried to create relationships between tasks that don't have DAGs yet. Set the DAG for at least one task and try again: [<Task(PubSubSubscriptionCreateOperator): create-subscription>, <Task(CustomPubSubSensor: pull-messages>]

when mocking:

TypeError: unsupported operand type(s) for >>: 'PubSubSubscriptionCreateOperator' and ‘CustomPubSubSensor’

0 Answers
Related