Skip to content

Commit 5ba5574

Browse files
dosisodyanyongyu
andauthored
Fix: Remove UNSET objects from lists (#26)
Co-authored-by: Ju4tCode <[email protected]>
1 parent b3faaad commit 5ba5574

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

githubkit/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ def exclude_unset(data: Any) -> Any:
3636
return data.__class__(
3737
(k, exclude_unset(v)) for k, v in data.items() if v is not UNSET
3838
)
39+
elif isinstance(data, list):
40+
return data.__class__(exclude_unset(i) for i in data)
3941
elif data is UNSET:
4042
return None
4143
return data

0 commit comments

Comments
 (0)