@@ -117,7 +117,7 @@ def is_supported_container_type(typ: Optional[type]) -> bool:
117117
118118
119119def validate_model_fields (model : Type ["RedisModel" ], field_values : Dict [str , Any ]):
120- for field_name in field_values . keys () :
120+ for field_name in field_values :
121121 if "__" in field_name :
122122 obj = model
123123 for sub_field in field_name .split ("__" ):
@@ -567,7 +567,7 @@ def resolve_value(
567567 # The value contains the TAG field separator. We can work
568568 # around this by breaking apart the values and unioning them
569569 # with multiple field:{} queries.
570- values : filter = filter ( None , value .split (separator_char ))
570+ values : List [ str ] = [ val for val in value .split (separator_char ) if val ]
571571 for value in values :
572572 value = escaper .escape (value )
573573 result += f"@{ field_name } :{{{ value } }}"
@@ -1195,12 +1195,12 @@ def to_string(s):
11951195 step = 2 # Because the result has content
11961196 offset = 1 # The first item is the count of total matches.
11971197
1198- for i in xrange (1 , len (res ), step ):
1198+ for i in range (1 , len (res ), step ):
11991199 fields_offset = offset
12001200
12011201 fields = dict (
12021202 dict (
1203- izip (
1203+ zip (
12041204 map (to_string , res [i + fields_offset ][::2 ]),
12051205 map (to_string , res [i + fields_offset ][1 ::2 ]),
12061206 )
@@ -1633,7 +1633,7 @@ def schema_for_type(
16331633 parent_type = typ ,
16341634 )
16351635 )
1636- return " " .join (filter ( None , sub_fields ) )
1636+ return " " .join ([ sub_field for sub_field in sub_fields if sub_field ] )
16371637 # NOTE: This is the termination point for recursion. We've descended
16381638 # into models and lists until we found an actual value to index.
16391639 elif should_index :
0 commit comments