Coverage for /home/airflow/.local/lib/python3.12/site-packages/airflow/api_fastapi/core_api/datamodels/event_logs.py: 100%

22 statements  

« prev     ^ index     » next       coverage.py v7.15.2, created at 2026-10-07 14:22 +0000

1# Licensed to the Apache Software Foundation (ASF) under one 

2# or more contributor license agreements. See the NOTICE file 

3# distributed with this work for additional information 

4# regarding copyright ownership. The ASF licenses this file 

5# to you under the Apache License, Version 2.0 (the 

6# "License"); you may not use this file except in compliance 

7# with the License. You may obtain a copy of the License at 

8# 

9# http://www.apache.org/licenses/LICENSE-2.0 

10# 

11# Unless required by applicable law or agreed to in writing, 

12# software distributed under the License is distributed on an 

13# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 

14# KIND, either express or implied. See the License for the 

15# specific language governing permissions and limitations 

16# under the License. 

17 

18from __future__ import annotations 

19 

20from collections.abc import Iterable 

21from datetime import datetime 

22 

23from pydantic import AliasPath, Field 

24 

25from airflow.api_fastapi.core_api.base import BaseModel 

26 

27 

28class EventLogResponse(BaseModel): 

29 """Event Log Response.""" 

30 

31 id: int = Field(alias="event_log_id") 

32 dttm: datetime = Field(alias="when") 

33 dag_id: str | None 

34 task_id: str | None 

35 run_id: str | None 

36 map_index: int | None 

37 try_number: int | None 

38 event: str 

39 logical_date: datetime | None 

40 owner: str | None 

41 extra: str | None 

42 dag_display_name: str | None = Field( 

43 validation_alias=AliasPath("dag_model", "dag_display_name"), default=None 

44 ) 

45 task_display_name: str | None = Field( 

46 validation_alias=AliasPath("task_instance", "task_display_name"), default=None 

47 ) 

48 

49 

50class EventLogCollectionResponse(BaseModel): 

51 """Event Log Collection Response.""" 

52 

53 event_logs: Iterable[EventLogResponse] 

54 total_entries: int