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


##########
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:
   I agree, this does indeed always return `false`, it slipped past me. It has 
never been an actual query for the DB calls. Instead, it’s used in the logic 
from the `dag.partial_subset` method, which doesn’t accept query.
   
   I think we can treat this as a simple `Annotated` parameter, similar to 
`DateTimeQuery`, but with a simple check to ensure it’s not passed with the 
request. While I know this won’t be an actual `query`, should we consider using 
DB calls to retrieve the `partial_subset` at that point? What do you think?
   
   ```
   def _optional_boolean(value: bool | None) -> bool | None:
       return value if value is not None else False
   
   QueryIncludeUpstream = Annotated[Union[bool, None], 
AfterValidator(_optional_boolean)]
   QueryIncludeDownstream = Annotated[Union[bool, None], 
AfterValidator(_optional_boolean)]
   ```



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