Skip to content

Commit 6e3c07f

Browse files
stainless-botrattrayalex
authored andcommitted
fix(client): properly handle optional file params (#88)
1 parent f63093e commit 6e3c07f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/finch/_utils/_utils.py

Lines changed: 4 additions & 1 deletion
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)