Skip to content

Commit 2efa54a

Browse files
committed
Walrus op for cleanup
1 parent efb775b commit 2efa54a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

ollama/_utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ def _get_json_type(python_type: Any) -> str | List[str]:
6363
if is_union(python_type):
6464
args = get_args(python_type)
6565
# Filter out None/NoneType from union args
66-
non_none_args = [arg for arg in args if arg not in (None, type(None))]
67-
if non_none_args:
66+
if non_none_args := [arg for arg in args if arg not in (None, type(None))]:
6867
if len(non_none_args) == 1:
6968
return _get_json_type(non_none_args[0])
7069
# For multiple types (e.g., int | str | None), return array of types

0 commit comments

Comments
 (0)