pierrejeambrun commented on code in PR #43947:
URL: https://github.com/apache/airflow/pull/43947#discussion_r1840821886
##########
airflow/api_fastapi/core_api/routes/public/event_logs.py:
##########
@@ -90,46 +96,47 @@ def get_event_logs(
).dynamic_depends()
),
],
- dag_id: str | None = None,
- task_id: str | None = None,
- run_id: str | None = None,
- map_index: int | None = None,
- try_number: int | None = None,
- owner: str | None = None,
- event: str | None = None,
- excluded_events: list[str] | None = Query(None),
- included_events: list[str] | None = Query(None),
- before: datetime | None = None,
- after: datetime | None = None,
+ dag_id: Annotated[FilterParam[str | None],
Depends(str_filter_param_factory(Log.dag_id))],
+ task_id: Annotated[FilterParam[str | None],
Depends(str_filter_param_factory(Log.task_id))],
+ run_id: Annotated[FilterParam[str | None],
Depends(str_filter_param_factory(Log.run_id))],
+ map_index: Annotated[FilterParam[int | None],
Depends(int_filter_param_factory(Log.map_index))],
+ try_number: Annotated[FilterParam[int | None],
Depends(int_filter_param_factory(Log.try_number))],
+ owner: Annotated[FilterParam[str | None],
Depends(str_filter_param_factory(Log.owner))],
+ event: Annotated[FilterParam[str | None],
Depends(str_filter_param_factory(Log.event))],
Review Comment:
This we need to think about. It's a little bit verbous and not super easy to
write. Maybe we can have only one meta `factory` that will call the appropriate
`type_factory` based on the given type ?
Maybe we can just extract that in to the parameter file, so we can just
reuse some:
```
LogTaskIdFilter = Annotated[FilterParam[str | None],
Depends(str_filter_param_factory(Log.dag_id))]
```
To not have to copy past that line between routes. Not sure, but we can try
to make this easier for the developer, that would be great.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]