Skip to content

Commit

Permalink
Implement get_log_template on DagRunPydantic (apache#38303)
Browse files Browse the repository at this point in the history
Also one drive-by fix removing unnecessary provide_session.
  • Loading branch information
dstandish authored Mar 20, 2024
1 parent b52e122 commit 93814d3
Showing 1 changed file with 6 additions and 2 deletions.
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()

0 comments on commit 93814d3

Please sign in to comment.