GitHub user blancocardenas created a discussion: How to generate a DAG task_id 
based on a pattern such as {bundle_name}_{name}.

What is the best way to dynamically modify the DAG task_id so that it contains 
a prefix as described below, based on the bundle name?

```python
@dag(start_date=datetime(2026, 1, 1), schedule="0 4 12 */1 *")
def sample_dag() -> HttpOperator:
    return HttpOperator(
        task_id=f"{{ bundle_name }}_{sample_dag.__name__}",
        endpoint="xml/{{ ds_nodash[:6] }}01",
        extra_options={"timeout": 90},
        log_response=True,
        method="GET",
    );
```

GitHub link: https://github.com/apache/airflow/discussions/61364

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to