josh-fell commented on issue #9415: URL: https://github.com/apache/airflow/issues/9415#issuecomment-921226065
In other PRs there was discussion of removing `PythonOperator` use in the example DAGs but I'm wondering what everyone's thoughts are on handling imported functions that are called in the DAG. Should we keep the `PythonOperator` use in these cases or show a syntax-sugar version like `op = task(imported_function)(func_args)`? For example, in the core [example_kubernetes_executor](https://github.com/apache/airflow/blob/3ddb389882128fe76941c8995a68629d8f2b324f/airflow/example_dags/example_kubernetes_executor.py) DAG: ```python from airflow.example_dags.libs.helper import print_stuff ... start_task = PythonOperator(task_id="start_task", python_callable=print_stuff) ``` Obviously we could always remove the reference to this function and add it directly to the DAG but there definitely use cases where folks are importing centralized, business-logic functions into DAGs but don't want to add Airflow-specific language to the functions themselves (i.e. decorating the function with `@task`). @ephraimbuddy Curious on your opinion here too. -- 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]
