Skip to content

Commit 8109b4d

Browse files
Update src/a2a/utils/helpers.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 7f63f64 commit 8109b4d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/a2a/utils/helpers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,7 @@ def _clean_empty(d: Any) -> Any:
353353
cleaned_dict = {k: cleaned_v for k, v in d.items() if (cleaned_v := _clean_empty(v)) is not None}
354354
return cleaned_dict or None
355355
if isinstance(d, list):
356-
cleaned_list = [_clean_empty(v) for v in d]
357-
cleaned_list = [v for v in cleaned_list if v is not None]
356+
cleaned_list = [cleaned_v for v in d if (cleaned_v := _clean_empty(v)) is not None]
358357
return cleaned_list or None
359358
if isinstance(d, str) and not d:
360359
return None

0 commit comments

Comments
 (0)