Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8830a6c

Browse filesBrowse files
fix(pydantic v1): more robust ModelField.annotation check
1 parent 6a2dfbb commit 8830a6c
Copy full SHA for 8830a6c

File tree

1 file changed

+1
-1
lines changed
Filter options

1 file changed

+1
-1
lines changed

‎src/openai/_models.py

Copy file name to clipboardExpand all lines: src/openai/_models.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any,
651651
# Note: if one variant defines an alias then they all should
652652
discriminator_alias = field_info.alias
653653

654-
if (annotation := getattr(field_info, 'annotation', None)) and is_literal_type(annotation):
654+
if (annotation := getattr(field_info, "annotation", None)) and is_literal_type(annotation):
655655
for entry in get_args(annotation):
656656
if isinstance(entry, str):
657657
mapping[entry] = variant

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.