bbovenzi commented on code in PR #64271:
URL: https://github.com/apache/airflow/pull/64271#discussion_r3065454612
##########
airflow-core/src/airflow/ui/src/layouts/Details/Graph/Graph.tsx:
##########
@@ -74,6 +78,19 @@ export const Graph = () => {
const hasActiveFilter = includeUpstream || includeDownstream;
+ const durationParam = searchParams.get(SearchParamsKeys.DURATION_GTE);
+ const mapIndexParam = searchParams.get(SearchParamsKeys.MAP_INDEX);
+ const durationVal = durationParam === null ? Number.NaN :
Number(durationParam);
+ const mapIndexVal = mapIndexParam === null ? Number.NaN :
Number(mapIndexParam);
+
+ const graphFilters: GraphFilterValues = {
+ durationThreshold: Number.isNaN(durationVal) ? undefined : durationVal,
+ mapIndex: Number.isNaN(mapIndexVal) ? undefined : mapIndexVal,
+ selectedOperators: searchParams.getAll(SearchParamsKeys.OPERATOR),
+ selectedStates: searchParams.getAll(SearchParamsKeys.TASK_STATE),
+ selectedTaskGroups: searchParams.getAll(SearchParamsKeys.TASK_GROUP),
+ };
Review Comment:
These still conflict with the TaskInstance filters. so we need to use other
keys like appending "graph-" onto all of them
##########
airflow-core/src/airflow/ui/src/context/groups/GroupsProvider.tsx:
##########
@@ -57,21 +54,19 @@ export const OpenGroupsProvider = ({ children, dagId }:
Props) => {
{ enabled: Boolean(dagId) && selectedVersion !== undefined },
);
- // Update allGroupIds whenever structure changes
useEffect(() => {
- const observedGroupIds = flattenGraphNodes(structure.nodes).allGroupIds;
+ const { allGroupIds: observedGroupIds } =
flattenGraphNodes(structure.nodes);
if (JSON.stringify(observedGroupIds) !==
JSON.stringify(allGroupIdsRef.current)) {
setAllGroupIds(observedGroupIds);
}
}, [structure.nodes, setAllGroupIds]);
- const debouncedSetOpenGroupIds = useDebouncedCallback(
- (newGroupIds: Array<string>) => {
- setOpenGroupIds(newGroupIds);
- },
- 100, // 100ms debounce for batch operations
- );
+ const { allOperators } = flattenGraphNodes(structure.nodes);
Review Comment:
We should try to call flattenGraphNodes only once in this file
--
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]