Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for on_dag_run_* Listeners with Task SDK #45492

Closed
Tracked by #45491
kaxil opened this issue Jan 8, 2025 · 2 comments
Closed
Tracked by #45491

Add support for on_dag_run_* Listeners with Task SDK #45492

kaxil opened this issue Jan 8, 2025 · 2 comments

Comments

@kaxil
Copy link
Member

kaxil commented Jan 8, 2025

Part of #45491

Port Listeners https://airflow.apache.org/docs/apache-airflow/stable/administration-and-deployment/listeners.html#listeners to Task SDK.

@hookspec
def on_dag_run_running(dag_run: DagRun, msg: str):
"""Execute when dag run state changes to RUNNING."""
@hookspec
def on_dag_run_success(dag_run: DagRun, msg: str):
"""Execute when dag run state changes to SUCCESS."""
@hookspec
def on_dag_run_failed(dag_run: DagRun, msg: str):
"""Execute when dag run state changes to FAIL."""

@mobuchowski
Copy link
Contributor

@kaxil those would continue to work (primarily) on scheduler, as scheduler is the one thing that changes the state of DR. The edge case is "mark run as failed" in the UI, but it's also not Task SDK related: #40735

@kaxil
Copy link
Member Author

kaxil commented Jan 8, 2025

You are right!

@kaxil kaxil closed this as completed Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants