@@ -117,7 +117,7 @@ def is_supported_container_type(typ: Optional[type]) -> bool:
117
117
118
118
119
119
def 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 :
121
121
if "__" in field_name :
122
122
obj = model
123
123
for sub_field in field_name .split ("__" ):
@@ -567,7 +567,7 @@ def resolve_value(
567
567
# The value contains the TAG field separator. We can work
568
568
# around this by breaking apart the values and unioning them
569
569
# 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 ]
571
571
for value in values :
572
572
value = escaper .escape (value )
573
573
result += f"@{ field_name } :{{{ value } }}"
@@ -1195,12 +1195,12 @@ def to_string(s):
1195
1195
step = 2 # Because the result has content
1196
1196
offset = 1 # The first item is the count of total matches.
1197
1197
1198
- for i in xrange (1 , len (res ), step ):
1198
+ for i in range (1 , len (res ), step ):
1199
1199
fields_offset = offset
1200
1200
1201
1201
fields = dict (
1202
1202
dict (
1203
- izip (
1203
+ zip (
1204
1204
map (to_string , res [i + fields_offset ][::2 ]),
1205
1205
map (to_string , res [i + fields_offset ][1 ::2 ]),
1206
1206
)
@@ -1633,7 +1633,7 @@ def schema_for_type(
1633
1633
parent_type = typ ,
1634
1634
)
1635
1635
)
1636
- return " " .join (filter ( None , sub_fields ) )
1636
+ return " " .join ([ sub_field for sub_field in sub_fields if sub_field ] )
1637
1637
# NOTE: This is the termination point for recursion. We've descended
1638
1638
# into models and lists until we found an actual value to index.
1639
1639
elif should_index :
0 commit comments