Skip to content

Commit 77b9914

Browse files
fix(client): properly handle optional file params (#88)
1 parent f940fb2 commit 77b9914

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/finch/_utils/_utils.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,15 @@ def _extract_items(
3838
path: Sequence[str],
3939
*,
4040
index: int,
41-
# TODO: rename
4241
flattened_key: str | None,
4342
) -> list[tuple[str, FileTypes]]:
4443
try:
4544
key = path[index]
4645
except IndexError:
46+
if isinstance(obj, NotGiven):
47+
# no value was provided - we can safely ignore
48+
return []
49+
4750
# We have exhausted the path, return the entry we found.
4851
if not isinstance(obj, bytes) and not isinstance(obj, tuple):
4952
raise RuntimeError(

0 commit comments

Comments
 (0)