jason810496 opened a new pull request, #43407:
URL: https://github.com/apache/airflow/pull/43407

   
   Closes: #43326  
   Related: #42370  
   
   ### Feature: Add `FilterParam`
   
   Instead of writing `if-else` statements for each available query parameter, 
as seen in the legacy API here: 
https://github.com/apache/airflow/blob/main/airflow/api_connexion/endpoints/event_log_endpoint.py#L89-L112,
 we can leverage `FilterParam` with `paginated_select` for improved clarity. 
The `filter` parameter of `paginated_select` needs to be of type 
`Sequence[BaseParam]`, as it requires `to_orm` to apply the filter.
   
   `FilterParam` provides common filtering options: `["in", "not_in", "eq", 
"ne", "lt", "le", "gt", "ge"]` to generate corresponding filtered selects in 
its `to_orm` method.
   This is particularly useful for APIs with numerous query parameters that 
filter Model that is not shared across other endpoints.
   
   Related discussion mentioned at 
https://github.com/apache/airflow/pull/43204#issuecomment-2434982295
   


-- 
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]

Reply via email to