Skip to content

Commit b40132a

Browse files
committed
Improve filter_tokens in core tokenizer
1 parent d10cc06 commit b40132a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

uncoder-core/app/translator/core/tokenizer.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ def tokenize(self, query: str) -> list[QUERY_TOKEN_TYPE]:
338338
@staticmethod
339339
def filter_tokens(
340340
tokens: list[QUERY_TOKEN_TYPE],
341-
token_type: Union[type[FieldValue], type[Field], type[Keyword], type[Identifier]],
341+
token_type: Union[type[FieldValue], type[Field], type[FieldField], type[Keyword], type[Identifier]],
342342
) -> list[QUERY_TOKEN_TYPE]:
343343
return [token for token in tokens if isinstance(token, token_type)]
344344

@@ -363,7 +363,9 @@ def get_field_tokens_from_func_args( # noqa: PLR0912
363363
result.extend(self.get_field_tokens_from_func_args(args=arg.args))
364364
result.extend(self.get_field_tokens_from_func_args(args=arg.by_clauses))
365365
result.extend(self.get_field_tokens_from_func_args(args=[arg.filter_]))
366-
elif isinstance(arg, (JoinFunction, UnionFunction)):
366+
elif isinstance(arg, JoinFunction):
367+
result.extend(self.get_field_tokens_from_func_args(args=arg.condition))
368+
elif isinstance(arg, UnionFunction):
367369
continue
368370
elif isinstance(arg, Function):
369371
result.extend(self.get_field_tokens_from_func_args(args=arg.args))

0 commit comments

Comments
 (0)