You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "uranusjr (via GitHub)" <gi...@apache.org> on 2024/12/02 07:43:50 UTC
[PR] Add 'airflow assets materialize' [airflow]
uranusjr opened a new pull request, #44558:
URL: https://github.com/apache/airflow/pull/44558
Next one for https://github.com/apache/airflow/issues/42317.
The command is designed for "given an asset, do what you need to do to make it emit an event". The procedure is
1. Find a DAG that has a task that defines the asset as outlet.
2. Trigger that DAG.
3. Return the scheduled DAG run.
Currently we error out if more than one DAG defines the asset as outlet. This is arguably bad practice anyway, but this may make some sense if the DAGs have dependency between them? We'll figure this out when someone thinks of a use case.
I have some doubts returning a DAG run from this. Intuitively we should have more of a distinction? There's no good alternative though; the closest thing we have related to assets is AssetEvent, but that does not get created *after* the DAG run finishes, and we don't want to block until then. DAG run is the only reasonable thing to return here. I guess we could wrap it? We still have a chance to change it before 3.0 is released.
Also, I needed to add a bunch of session management to trigger_dag so the same session is passed down correctly. Previously, trigger_dag always create a DagRun object detached to a session because it creates its own session that only lives inside the function. This causes an issue when we serialize it into a Pydantic model since it can no longer access the related fields.
--
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
Re: [PR] Add 'airflow assets materialize' [airflow]
Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr merged PR #44558:
URL: https://github.com/apache/airflow/pull/44558
--
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