fix: check allowed file extensions in rag transform pipeline and use set type instead of list for performance in file extensions (#26593)

This commit is contained in:
Bowen Liang
2025-10-09 10:21:56 +08:00
committed by GitHub
parent 89821d66bb
commit 40d35304ea
3 changed files with 45 additions and 16 deletions

View File

@@ -0,0 +1,14 @@
def convert_to_lower_and_upper_set(inputs: list[str] | set[str]) -> set[str]:
"""
Convert a list or set of strings to a set containing both lower and upper case versions of each string.
Args:
inputs (list[str] | set[str]): A list or set of strings to be converted.
Returns:
set[str]: A set containing both lower and upper case versions of each string.
"""
if not inputs:
return set()
else:
return {case for s in inputs if s for case in (s.lower(), s.upper())}