shreyaskj-0710 commented on code in PR #54382:
URL: https://github.com/apache/airflow/pull/54382#discussion_r2269367713
##########
airflow-core/src/airflow/api_fastapi/common/parameters.py:
##########
@@ -540,6 +540,22 @@ def is_active(self) -> bool:
self.value.lower_bound is not None or self.value.upper_bound is
not None
)
+class _IsDagScheduledFilter(BaseParam[bool]):
+ """Filter on timetable_description."""
+
+ def to_orm(self, select: Select) -> Select:
+ if not self.value is None and self.skip_none:
+ if not self.value:
Review Comment:
Hi @bugraoz93 ,
This condition is required because the is_scheduled query parameter is
optional.
The is_scheduled parameter can take one of three values:
- True → retrieve scheduled DAGs
- False → retrieve unscheduled DAGs
- None → when is_scheduled is not provided in the query parameters.
Therefore, the check 'if self.value is not None' will be True when
is_scheduled is explicitly set to True or False, and False when the parameter
is omitted from the API request.
if not self.value will be checked when is_scheduled is explicitly set to
True or False.
Code snippet :
if self.value is not None (or if not self.value is None)
-> Filters out the case where is_scheduled is not provided in the query.
if not self.value (inside)
-> Specifically handles the case where is_scheduled=False (unscheduled
DAGs).
else (inside)
-> Handles the case where is_scheduled=True (scheduled DAGs).
--
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]