Skip to content

Commit

Permalink
Fix Get Event Logs type
Browse files Browse the repository at this point in the history
  • Loading branch information
jason810496 committed Nov 23, 2024
1 parent 0bb4569 commit d329025
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 39 deletions.
56 changes: 39 additions & 17 deletions airflow/api_fastapi/core_api/openapi/v1-generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2784,73 +2784,95 @@ paths:
in: query
required: false
schema:
type: string
anyOf:
- type: string
- type: 'null'
title: Dag Id
- name: task_id
in: query
required: false
schema:
type: string
anyOf:
- type: string
- type: 'null'
title: Task Id
- name: run_id
in: query
required: false
schema:
type: string
anyOf:
- type: string
- type: 'null'
title: Run Id
- name: map_index
in: query
required: false
schema:
type: integer
anyOf:
- type: integer
- type: 'null'
title: Map Index
- name: try_number
in: query
required: false
schema:
type: integer
anyOf:
- type: integer
- type: 'null'
title: Try Number
- name: owner
in: query
required: false
schema:
type: string
anyOf:
- type: string
- type: 'null'
title: Owner
- name: event
in: query
required: false
schema:
type: string
anyOf:
- type: string
- type: 'null'
title: Event
- name: excluded_events
in: query
required: false
schema:
type: array
items:
type: string
anyOf:
- type: array
items:
type: string
- type: 'null'
title: Excluded Events
- name: included_events
in: query
required: false
schema:
type: array
items:
type: string
anyOf:
- type: array
items:
type: string
- type: 'null'
title: Included Events
- name: before
in: query
required: false
schema:
type: string
format: date-time
anyOf:
- type: string
format: date-time
- type: 'null'
title: Before
- name: after
in: query
required: false
schema:
type: string
format: date-time
anyOf:
- type: string
format: date-time
- type: 'null'
title: After
responses:
'200':
Expand Down
24 changes: 13 additions & 11 deletions airflow/api_fastapi/core_api/routes/public/event_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,28 +87,30 @@ def get_event_logs(
).dynamic_depends()
),
],
dag_id: Annotated[FilterParam[str | None], Depends(filter_param_factory(Log.dag_id, str))],
task_id: Annotated[FilterParam[str | None], Depends(filter_param_factory(Log.task_id, str))],
run_id: Annotated[FilterParam[str | None], Depends(filter_param_factory(Log.run_id, str))],
map_index: Annotated[FilterParam[int | None], Depends(filter_param_factory(Log.map_index, int))],
try_number: Annotated[FilterParam[int | None], Depends(filter_param_factory(Log.try_number, int))],
owner: Annotated[FilterParam[str | None], Depends(filter_param_factory(Log.owner, str))],
event: Annotated[FilterParam[str | None], Depends(filter_param_factory(Log.event, str))],
dag_id: Annotated[FilterParam[str | None], Depends(filter_param_factory(Log.dag_id, str | None))],
task_id: Annotated[FilterParam[str | None], Depends(filter_param_factory(Log.task_id, str | None))],
run_id: Annotated[FilterParam[str | None], Depends(filter_param_factory(Log.run_id, str | None))],
map_index: Annotated[FilterParam[int | None], Depends(filter_param_factory(Log.map_index, int | None))],
try_number: Annotated[FilterParam[int | None], Depends(filter_param_factory(Log.try_number, int | None))],
owner: Annotated[FilterParam[str | None], Depends(filter_param_factory(Log.owner, str | None))],
event: Annotated[FilterParam[str | None], Depends(filter_param_factory(Log.event, str | None))],
excluded_events: Annotated[
FilterParam[list[str] | None],
Depends(filter_param_factory(Log.event, list[str], FilterOptionEnum.NOT_IN, "excluded_events")),
Depends(
filter_param_factory(Log.event, list[str] | None, FilterOptionEnum.NOT_IN, "excluded_events")
),
],
included_events: Annotated[
FilterParam[list[str] | None],
Depends(filter_param_factory(Log.event, list[str], FilterOptionEnum.IN, "included_events")),
Depends(filter_param_factory(Log.event, list[str] | None, FilterOptionEnum.IN, "included_events")),
],
before: Annotated[
FilterParam[datetime | None],
Depends(filter_param_factory(Log.dttm, datetime, FilterOptionEnum.LESS_THAN, "before")),
Depends(filter_param_factory(Log.dttm, datetime | None, FilterOptionEnum.LESS_THAN, "before")),
],
after: Annotated[
FilterParam[datetime | None],
Depends(filter_param_factory(Log.dttm, datetime, FilterOptionEnum.GREATER_THAN, "after")),
Depends(filter_param_factory(Log.dttm, datetime | None, FilterOptionEnum.GREATER_THAN, "after")),
],
) -> EventLogCollectionResponse:
"""Get all Event Logs."""
Expand Down
22 changes: 11 additions & 11 deletions airflow/ui/openapi-gen/requests/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1517,20 +1517,20 @@ export type GetEventLogData = {
export type GetEventLogResponse = EventLogResponse;

export type GetEventLogsData = {
after?: string;
before?: string;
dagId?: string;
event?: string;
excludedEvents?: Array<string>;
includedEvents?: Array<string>;
after?: string | null;
before?: string | null;
dagId?: string | null;
event?: string | null;
excludedEvents?: Array<string> | null;
includedEvents?: Array<string> | null;
limit?: number;
mapIndex?: number;
mapIndex?: number | null;
offset?: number;
orderBy?: string;
owner?: string;
runId?: string;
taskId?: string;
tryNumber?: number;
owner?: string | null;
runId?: string | null;
taskId?: string | null;
tryNumber?: number | null;
};

export type GetEventLogsResponse = EventLogCollectionResponse;
Expand Down

0 comments on commit d329025

Please sign in to comment.