BrianLii commented on code in PR #54640:
URL: https://github.com/apache/airflow/pull/54640#discussion_r2308391154


##########
airflow-core/src/airflow/ui/src/components/Assets/AssetEvents.tsx:
##########
@@ -64,6 +69,64 @@ export const AssetEvents = ({
       { label: translate("sortBy.oldestFirst"), value: "timestamp" },
     ],
   });
+  const runTypes = ["", "asset_triggered", "backfill", "manual", "scheduled"];
+  const runTypeOptions = createListCollection({
+    items: runTypes.map((type) => ({
+      label: type === "" ? "\u00A0" : translate(`common:runTypes.${type}`),
+      value: type,
+    })),
+  });
+  const [searchParams, setSearchParams] = useSearchParams();
+  const { DAG_ID_PATTERN, END_DATE, RUN_TYPE, START_DATE, TASK_ID_PATTERN } = 
SearchParamsKeys;
+  const startDate = searchParams.get(START_DATE) ?? "";
+  const endDate = searchParams.get(END_DATE) ?? "";
+  const dagIdPattern = searchParams.get(DAG_ID_PATTERN) ?? "";
+  const taskIdPattern = searchParams.get(TASK_ID_PATTERN) ?? "";
+  const runType = searchParams.get(RUN_TYPE) ?? "";
+
+  const handleFilterChange = useCallback(
+    (paramKey: string) => (value: string) => {
+      if (value === "") {
+        searchParams.delete(paramKey);
+      } else {
+        searchParams.set(paramKey, value);
+      }
+      setSearchParams(searchParams);
+    },
+    [searchParams, setSearchParams],
+  );
+  const filteredData = useMemo(() => {

Review Comment:
   Currently, the API only supports exact (full-string) filtering for Dag ID 
and Task ID. Should we consider adding substring or wildcard matching? Also, 
the API does not yet support filtering by Run Type.
   
   imho, since the current implementation sends all data to the frontend, 
adding a filtering mechanism there is unlikely to have a significant 
performance impact.



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