You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "atul-astronomer (via GitHub)" <gi...@apache.org> on 2025/02/24 09:27:37 UTC
[I] AttributeError: 'UUID' object has no attribute 'dag_id' [airflow]
atul-astronomer opened a new issue, #47010:
URL: https://github.com/apache/airflow/issues/47010
### Apache Airflow version
3.0.0a1
### If "Other Airflow 2 version" selected, which one?
_No response_
### What happened?
Getting an error while running TriggerDagRunOperator
```javascript
{"timestamp":"2025-02-24T07:48:23.447600","level":"error","event":"Top level error","logger":"task",
"error_detail":[{"exc_type":"AttributeError","exc_value":"'UUID' object has no attribute 'dag_id'","syntax_error":null,"is_cause":false,"frames":[{"filename":"/opt/airflow/task_sdk/src/airflow/sdk/execution_time/task_runner.py","lineno":791,"name":"main"},
{"filename":"/opt/airflow/task_sdk/src/airflow/sdk/execution_time/task_runner.py","lineno":765,"name":"finalize"},{"filename":"/opt/airflow/providers/standard/src/airflow/providers/standard/operators/trigger_dagrun.py","lineno":
80,"name":"get_link"},{"filename":"/opt/airflow/airflow/utils/session.py","lineno":101,"name":"wrapper"},
{"filename":"/opt/airflow/airflow/models/renderedtifields.py","lineno":172,"name":"get_templated_fields"}]}]}
```
### What you think should happen instead?
The Dag should pass as it was passing in alpha3.
### How to reproduce
Run the below DAG:
**Controller DAG**
```python
from airflow import DAG
from airflow.operators.trigger_dagrun import TriggerDagRunOperator
from pendulum import today
"""This example illustrates the use of the TriggerDagRunOperator. There are 2
entities at work in this scenario:
1. The Controller DAG - the DAG that conditionally executes the trigger
2. The Target DAG - DAG being triggered (in trigger_dagrun_target.py)
"""
dag = DAG(
dag_id="trigger_controller_dag",
default_args={"owner": "airflow", "start_date": today('UTC').add(days=-2)},
schedule=None,
tags=["core"],
)
trigger = TriggerDagRunOperator(
task_id="test_trigger_dagrun",
trigger_dag_id="trigger_target_dag",
reset_dag_run=True,
wait_for_completion=True,
conf={"message": "Hello World"},
dag=dag,
)
```
**Target DAG:**
```python
from airflow.models import DAG
from airflow.providers.standard.operators.bash import BashOperator
from airflow.providers.standard.operators.python import PythonOperator
from pendulum import today
dag = DAG(
dag_id="trigger_target_dag",
default_args={"start_date": today('UTC').add(days=-2), "owner": "Airflow"},
tags=["core"],
schedule=None, # This must be none so it's triggered by the controller
is_paused_upon_creation=False, # This must be set so other workers can pick this dag up. mabye it's a bug idk
)
def run_this_func(**context):
print(
f"Remotely received value of {context['dag_run'].conf['message']} for key=message "
)
run_this = PythonOperator(
task_id="run_this",
python_callable=run_this_func,
dag=dag,
)
# You can also access the DagRun object in templates
bash_task = BashOperator(
task_id="bash_task",
bash_command='echo "Here is the message: $message"',
env={"message": '{{ dag_run.conf["message"] if dag_run else "" }}'},
dag=dag,
)
Version: [v3.0.0a4](https://pypi.python.org/pypi/apache-airflow/3.0.0a4)
```
### Operating System
Linux
### Versions of Apache Airflow Providers
_No response_
### Deployment
Other
### Deployment details
_No response_
### Anything else?
_No response_
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
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: commits-unsubscribe@airflow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] AttributeError: 'UUID' object has no attribute 'dag_id' [airflow]
Posted by "jedcunningham (via GitHub)" <gi...@apache.org>.
jedcunningham closed issue #47010: AttributeError: 'UUID' object has no attribute 'dag_id'
URL: https://github.com/apache/airflow/issues/47010
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org