We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d92f959 commit 258f265Copy full SHA for 258f265
src/openai/_utils/_transform.py
@@ -173,6 +173,11 @@ def _transform_recursive(
173
# Iterable[T]
174
or (is_iterable_type(stripped_type) and is_iterable(data) and not isinstance(data, str))
175
):
176
+ # dicts are technically iterable, but it is an iterable on the keys of the dict and is not usually
177
+ # intended as an iterable, so we don't transform it.
178
+ if isinstance(data, dict):
179
+ return cast(object, data)
180
+
181
inner_type = extract_type_arg(stripped_type, 0)
182
return [_transform_recursive(d, annotation=annotation, inner_type=inner_type) for d in data]
183
0 commit comments