Skip to content

Commit 371fe7a

Browse files
authored
fix: type error in list-operator (langgenius#22803)
1 parent c6d7328 commit 371fe7a

File tree

5 files changed

+3
-8
lines changed

5 files changed

+3
-8
lines changed

api/core/workflow/nodes/list_operator/node.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,10 @@ def _extract_slice(
184184
value = int(self.graph_runtime_state.variable_pool.convert_template(self._node_data.extract_by.serial).text)
185185
if value < 1:
186186
raise ValueError(f"Invalid serial index: must be >= 1, got {value}")
187+
if value > len(variable.value):
188+
raise InvalidKeyError(f"Invalid serial index: must be <= {len(variable.value)}, got {value}")
187189
value -= 1
188-
if len(variable.value) > int(value):
189-
result = variable.value[value]
190-
else:
191-
result = ""
190+
result = variable.value[value]
192191
return variable.model_copy(update={"value": [result]})
193192

194193

web/app/components/base/date-and-time-picker/common/option-list-item.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ const OptionListItem: FC<OptionListItemProps> = ({
1818
useEffect(() => {
1919
if (isSelected && !noAutoScroll)
2020
listItemRef.current?.scrollIntoView({ behavior: 'instant' })
21-
// eslint-disable-next-line react-hooks/exhaustive-deps
2221
}, [])
2322

2423
return (

web/app/components/base/date-and-time-picker/time-picker/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ const TimePicker = ({
5252
else {
5353
setSelectedTime(prev => prev ? getDateWithTimezone({ date: prev, timezone }) : undefined)
5454
}
55-
// eslint-disable-next-line react-hooks/exhaustive-deps
5655
}, [timezone])
5756

5857
const handleClickTrigger = (e: React.MouseEvent) => {

web/app/components/plugins/plugin-page/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ const PluginPage = ({
117117
showInstallFromMarketplace()
118118
}
119119
})()
120-
// eslint-disable-next-line react-hooks/exhaustive-deps
121120
}, [packageId, bundleInfo])
122121

123122
const {

web/service/use-plugins.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,6 @@ export const usePluginTaskList = (category?: PluginType) => {
519519
refreshPluginList(category ? { category } as any : undefined, !category)
520520
}
521521
}
522-
// eslint-disable-next-line react-hooks/exhaustive-deps
523522
}, [isRefetching])
524523

525524
const handleRefetch = useCallback(() => {

0 commit comments

Comments
 (0)