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

Ensure Task Instance Listeners work with Task SDK #45423

Open
kaxil opened this issue Jan 6, 2025 · 0 comments · May be fixed by #45294
Open

Ensure Task Instance Listeners work with Task SDK #45423

kaxil opened this issue Jan 6, 2025 · 0 comments · May be fixed by #45294
Assignees
Labels
area:Listeners area:task-execution-interface-aip72 AIP-72: Task Execution Interface (TEI) aka Task SDK

Comments

@kaxil
Copy link
Member

kaxil commented Jan 6, 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_task_instance_running(
previous_state: TaskInstanceState | None, task_instance: TaskInstance, session: Session | None
):
"""Execute when task state changes to RUNNING. previous_state can be None."""
@hookspec
def on_task_instance_success(
previous_state: TaskInstanceState | None, task_instance: TaskInstance, session: Session | None
):
"""Execute when task state changes to SUCCESS. previous_state can be None."""
@hookspec
def on_task_instance_failed(
previous_state: TaskInstanceState | None,
task_instance: TaskInstance,
error: None | str | BaseException,
session: Session | None,
):
"""Execute when task state changes to FAIL. previous_state can be None."""

@kaxil kaxil added the area:task-execution-interface-aip72 AIP-72: Task Execution Interface (TEI) aka Task SDK label Jan 6, 2025
@kaxil kaxil moved this from Next 2 Weeks to Todo in AIP-72 - Task Execution Interface and SDK Jan 6, 2025
@kaxil kaxil moved this from Todo to In Progress in AIP-72 - Task Execution Interface and SDK Jan 8, 2025
@kaxil kaxil moved this from In Progress to Todo in AIP-72 - Task Execution Interface and SDK Jan 8, 2025
@kaxil kaxil changed the title Ensure Listeners work with Task SDK Ensure Task Instance Listeners work with Task SDK Jan 8, 2025
@vikramkoka vikramkoka moved this from Todo to In Progress in AIP-72 - Task Execution Interface and SDK Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:Listeners area:task-execution-interface-aip72 AIP-72: Task Execution Interface (TEI) aka Task SDK
Projects
2 participants