You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
I'd like to see if it's a good idea to have an event listener for Dag Processing events, for example, when a new or modified dag is loaded in the dag bag. Right now, I can see only events when a dag state changes or a task instance state changes but I don't see an event when a dag is loaded.
Use case/motivation
In my use case, I'm planning to add some metadata to a dag file and read it when the dag is loaded and then run a small function like monkeypatching the dag depending on the metadata.
There's a PEP https://peps.python.org/pep-0723/ to one suggestion to embed a script inside a python file and I'd like to read this when a dag is processed and parsed.
So right now what I can think of is scanning the whole repo and parse the files, which could maybe be done by a running dag, but since Airflow is already processing new dags so I think it might be a better idea to have these event listeners and implementing event handlers.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I'd like to see if it's a good idea to have an event listener for Dag Processing events, for example, when a new or modified dag is loaded in the dag bag. Right now, I can see only events when a dag state changes or a task instance state changes but I don't see an event when a dag is loaded.
Use case/motivation
In my use case, I'm planning to add some metadata to a dag file and read it when the dag is loaded and then run a small function like monkeypatching the dag depending on the metadata.
There's a PEP https://peps.python.org/pep-0723/ to one suggestion to embed a script inside a python file and I'd like to read this when a dag is processed and parsed.
So right now what I can think of is scanning the whole repo and parse the files, which could maybe be done by a running dag, but since Airflow is already processing new dags so I think it might be a better idea to have these event listeners and implementing event handlers.
Beta Was this translation helpful? Give feedback.
All reactions