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

Implement get_log_template on DagRunPydantic #38303

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions airflow/serialization/pydantic/dag_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,10 @@ def get_task_instances(
"""
raise NotImplementedError()

@provide_session
def get_task_instance(
self,
task_id: str,
session: Session = NEW_SESSION,
session: Session,
*,
map_index: int = -1,
) -> TI | TaskInstancePydantic | None:
Expand All @@ -99,6 +98,11 @@ def get_task_instance(
map_index=map_index,
)

def get_log_template(self, session: Session):
from airflow.models.dagrun import DagRun

return DagRun._get_log_template(log_template_id=self.log_template_id)


if is_pydantic_2_installed():
DagRunPydantic.model_rebuild()
Loading