pierrejeambrun commented on code in PR #44332:
URL: https://github.com/apache/airflow/pull/44332#discussion_r1871155810


##########
airflow/api_fastapi/common/parameters.py:
##########
@@ -572,3 +636,7 @@ def _transform_ti_states(states: list[str] | None) -> 
list[TaskInstanceState | N
 QueryAssetDagIdPatternSearch = Annotated[
     _DagIdAssetReferenceFilter, Depends(_DagIdAssetReferenceFilter().depends)
 ]
+
+# UI Shared
+QueryIncludeUpstream = Annotated[Union[bool, None], Depends(lambda: False)]
+QueryIncludeDownstream = Annotated[Union[bool, None], Depends(lambda: False)]

Review Comment:
   What is `Depends(lambda: False)` that part for ? I guess it is to have a 
common default to `False` ? But I think this will actually always return False. 
(there's no `Query()` involved)
   
   Usually we would do, this but we can't specify the default value.
   ```
   QueryIncludeUpstream = Annotated[bool, Query()]
   ```
   
   Maybe the easiest and more consistent way is to also use 
`filter_param_factory` ? (Default value is properly handled, Query, too). We 
just need to give `.value` to the function. 
   
   



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to