EssKayz commented on issue #26619:
URL: https://github.com/apache/airflow/issues/26619#issuecomment-1264676637
Still not exactly sure how to get that to work, unsure if I understood the
suggestion wrong, but at least done in a similar way as with PythonOperators,
no task is generated to the DAG
```
from airflow.decorators import task
def get_data_from_db(table_name, **kwargs):
@task(task_id=f'get_db_{table_name}')
def get_db_objects(**kwargs):
return {}
with dag:
test_task = get_data_from_db(
table_name='person'
)
```
--
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]