bbovenzi commented on code in PR #71467:
URL: https://github.com/apache/airflow/pull/71467#discussion_r3778226662


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/ui/backfills.py:
##########
@@ -52,6 +55,14 @@
 def list_backfills_ui(
     limit: QueryLimit,
     offset: QueryOffset,
+    start_date_range: Annotated[RangeFilter, 
Depends(datetime_range_filter_factory("from_date", Backfill))],
+    end_date_range: Annotated[RangeFilter, 
Depends(datetime_range_filter_factory("to_date", Backfill))],
+    created_at: Annotated[RangeFilter, 
Depends(datetime_range_filter_factory("created_at", Backfill))],
+    completed_at: Annotated[RangeFilter, 
Depends(datetime_range_filter_factory("completed_at", Backfill))],
+    max_active_runs: Annotated[RangeFilter, 
Depends(float_range_filter_factory("max_active_runs", Backfill))],

Review Comment:
   This should be an integer range not a float?



##########
airflow-core/src/airflow/ui/src/pages/Dag/Backfills/Backfills.tsx:
##########
@@ -126,10 +142,38 @@ export const Backfills = () => {
   const { backfillId, dagId = "" } = useParams();
   const selectedBackfillId = Number(backfillId);
   const hasSelectedBackfill = Number.isInteger(selectedBackfillId) && 
selectedBackfillId > 0;
+
+  const [searchParams] = useSearchParams();
+
+  const fromDateGte = searchParams.get(FROM_DATE_GTE_PARAM);
+  const fromDateLte = searchParams.get(FROM_DATE_LTE_PARAM);
+  const toDateGte = searchParams.get(TO_DATE_GTE_PARAM);
+  const toDateLte = searchParams.get(TO_DATE_LTE_PARAM);
+  const createdAtGte = searchParams.get(CREATED_AT_GTE_PARAM);
+  const createdAtLte = searchParams.get(CREATED_AT_LTE_PARAM);
+  const completedAtGte = searchParams.get(COMPLETED_AT_GTE_PARAM);
+  const completedAtLte = searchParams.get(COMPLETED_AT_LTE_PARAM);
+  const maxActiveRunsGte = searchParams.get(MAX_ACTIVE_RUNS_GTE_PARAM);
+  const maxActiveRunsLte = searchParams.get(MAX_ACTIVE_RUNS_LTE_PARAM);
+  const reprocessBehavior = searchParams.get(REPROCESS_BEHAVIOR_PARAM) as 
ReprocessBehavior | undefined;

Review Comment:
   We should validate the param not just blindly cast it. Especially since url 
params are just strings.



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