Skip to content

Commit 5638c1d

Browse files
release: 1.23.6 (openai#1372)
* chore(internal): update test helper function (openai#1371) * release: 1.23.6
1 parent 0777a87 commit 5638c1d

File tree

5 files changed

+27
-4
lines changed

5 files changed

+27
-4
lines changed

.release-please-manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.23.5"
2+
".": "1.23.6"
33
}

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 1.23.6 (2024-04-25)
4+
5+
Full Changelog: [v1.23.5...v1.23.6](https://github.com/openai/openai-python/compare/v1.23.5...v1.23.6)
6+
7+
### Chores
8+
9+
* **internal:** update test helper function ([#1371](https://github.com/openai/openai-python/issues/1371)) ([6607c4a](https://github.com/openai/openai-python/commit/6607c4a491fd1912f9222d6fe464ccef6e865eac))
10+
311
## 1.23.5 (2024-04-24)
412

513
Full Changelog: [v1.23.4...v1.23.5](https://github.com/openai/openai-python/compare/v1.23.4...v1.23.5)

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "openai"
3-
version = "1.23.5"
3+
version = "1.23.6"
44
description = "The official Python library for the openai API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

src/openai/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "openai"
4-
__version__ = "1.23.5" # x-release-please-version
4+
__version__ = "1.23.6" # x-release-please-version

tests/utils.py

+16-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,22 @@ def assert_matches_type(
9797
assert_matches_type(key_type, key, path=[*path, "<dict key>"])
9898
assert_matches_type(items_type, item, path=[*path, "<dict item>"])
9999
elif is_union_type(type_):
100-
for i, variant in enumerate(get_args(type_)):
100+
variants = get_args(type_)
101+
102+
try:
103+
none_index = variants.index(type(None))
104+
except ValueError:
105+
pass
106+
else:
107+
# special case Optional[T] for better error messages
108+
if len(variants) == 2:
109+
if value is None:
110+
# valid
111+
return
112+
113+
return assert_matches_type(type_=variants[not none_index], value=value, path=path)
114+
115+
for i, variant in enumerate(variants):
101116
try:
102117
assert_matches_type(variant, value, path=[*path, f"variant {i}"])
103118
return

0 commit comments

Comments
 (0)