phi-friday opened a new issue, #39863:
URL: https://github.com/apache/airflow/issues/39863
### Apache Airflow version
2.9.1
### If "Other Airflow 2 version" selected, which one?
_No response_
### What happened?
When I modified the dataset during runtime, as shown below,
```python
outlets: list[Dataset] = context["outlets"] # pyright:
ignore[reportTypedDictNotRequiredAccess]
outlets[0].extra = (outlets[0].extra or {}) | {"test_value": 123}
```
In XCOM, I can see these changed values.
<img width="948" alt="스크린샷 2024-05-27 오전 9 47 18"
src="https://github.com/apache/airflow/assets/19867547/4b780b0b-3c7c-4d75-aa93-bb215257dfdd">
However, it will look different in detail.
<img width="1000" alt="스크린샷 2024-05-27 오전 9 47 32"
src="https://github.com/apache/airflow/assets/19867547/74615ad2-943f-4f71-858d-8ccb976fb557">
And if I check the triggered DAG, extra is passed unchanged.
<img width="1025" alt="스크린샷 2024-05-27 오전 9 47 45"
src="https://github.com/apache/airflow/assets/19867547/e4fafd5a-d756-4fa3-bd44-85660bd1c4e5">
### What you think should happen instead?
It has to be one or the other.
### How to reproduce
```python
from __future__ import annotations
from datetime import UTC, datetime
from airflow.datasets import Dataset
from airflow.decorators import dag, task
dataset = Dataset(uri="dataset_example")
@dag(
dag_id="append_test",
start_date=datetime(2023, 11, 1, tzinfo=UTC),
schedule=None,
default_args={"do_xcom_push": False},
catchup=False,
max_active_runs=1,
tags=["dataset", "example"],
)
def dataset_trigger_example() -> None: # noqa: D103
@task.python(outlets=[dataset])
def setup_dataset() -> None:
from airflow.operators.python import get_current_context
context = get_current_context()
outlets: list[Dataset] = context["outlets"] # pyright:
ignore[reportTypedDictNotRequiredAccess]
outlets[0].extra = (outlets[0].extra or {}) | {"test_value": 123}
_ = setup_dataset()
@dag(
dag_id="append_test_comsumer",
start_date=datetime(2023, 11, 1, tzinfo=UTC),
schedule=[dataset],
default_args={"do_xcom_push": False},
catchup=False,
max_active_runs=1,
tags=["dataset", "example"],
)
def dataset_consumer_example() -> None: # noqa: D103
@task.python()
def echo_in_python() -> None:
from pprint import pprint
from airflow.operators.python import get_current_context
context = get_current_context()
pprint(context.get("triggering_dataset_events")) # noqa: T203
_ = echo_in_python()
dataset_trigger_example()
dataset_consumer_example()
```
### Operating System
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)" NAME="Debian GNU/Linux"
VERSION_ID="12" VERSION="12 (bookworm)" VERSION_CODENAME=bookworm ID=debian
HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
### Versions of Apache Airflow Providers
apache-airflow-providers-celery==3.7.0
apache-airflow-providers-common-io==1.3.1
apache-airflow-providers-common-sql==1.13.0
apache-airflow-providers-docker==3.11.0
apache-airflow-providers-fab==1.1.0
apache-airflow-providers-ftp==3.9.0
apache-airflow-providers-http==4.11.0
apache-airflow-providers-imap==3.6.0
apache-airflow-providers-odbc==4.6.0
apache-airflow-providers-postgres==5.11.0
apache-airflow-providers-redis==3.7.0
apache-airflow-providers-smtp==1.7.0
apache-airflow-providers-sqlite==3.8.0
### Deployment
Docker-Compose
### 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]