File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 16
16
lru_cache ,
17
17
is_mapping ,
18
18
is_iterable ,
19
+ is_sequence ,
19
20
)
20
21
from .._files import is_base64_file_input
21
22
from ._typing import (
24
25
extract_type_arg ,
25
26
is_iterable_type ,
26
27
is_required_type ,
28
+ is_sequence_type ,
27
29
is_annotated_type ,
28
30
strip_annotated_type ,
29
31
)
@@ -184,6 +186,8 @@ def _transform_recursive(
184
186
(is_list_type (stripped_type ) and is_list (data ))
185
187
# Iterable[T]
186
188
or (is_iterable_type (stripped_type ) and is_iterable (data ) and not isinstance (data , str ))
189
+ # Sequence[T]
190
+ or (is_sequence_type (stripped_type ) and is_sequence (data ) and not isinstance (data , str ))
187
191
):
188
192
# dicts are technically iterable, but it is an iterable on the keys of the dict and is not usually
189
193
# intended as an iterable, so we don't transform it.
@@ -346,6 +350,8 @@ async def _async_transform_recursive(
346
350
(is_list_type (stripped_type ) and is_list (data ))
347
351
# Iterable[T]
348
352
or (is_iterable_type (stripped_type ) and is_iterable (data ) and not isinstance (data , str ))
353
+ # Sequence[T]
354
+ or (is_sequence_type (stripped_type ) and is_sequence (data ) and not isinstance (data , str ))
349
355
):
350
356
# dicts are technically iterable, but it is an iterable on the keys of the dict and is not usually
351
357
# intended as an iterable, so we don't transform it.
You can’t perform that action at this time.
0 commit comments