We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7f63f64 commit 8109b4dCopy full SHA for 8109b4d
src/a2a/utils/helpers.py
@@ -353,8 +353,7 @@ def _clean_empty(d: Any) -> Any:
353
cleaned_dict = {k: cleaned_v for k, v in d.items() if (cleaned_v := _clean_empty(v)) is not None}
354
return cleaned_dict or None
355
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]
+ cleaned_list = [cleaned_v for v in d if (cleaned_v := _clean_empty(v)) is not None]
358
return cleaned_list or None
359
if isinstance(d, str) and not d:
360
return None
0 commit comments