@@ -338,7 +338,7 @@ def tokenize(self, query: str) -> list[QUERY_TOKEN_TYPE]:
338338@staticmethod
339339def filter_tokens (
340340tokens :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 ]:
343343return [token for token in tokens if isinstance (token ,token_type )]
344344
@@ -363,7 +363,9 @@ def get_field_tokens_from_func_args( # noqa: PLR0912
363363result .extend (self .get_field_tokens_from_func_args (args = arg .args ))
364364result .extend (self .get_field_tokens_from_func_args (args = arg .by_clauses ))
365365result .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 ):
367369continue
368370elif isinstance (arg ,Function ):
369371result .extend (self .get_field_tokens_from_func_args (args = arg .args ))