Jan-11-2022, 10:15 PM
(This post was last modified: Jan-11-2022, 10:15 PM by deanhystad.)
That error trace is not for the code you posted.
Your error is dictionary does not have a method named "value", it has "values".
I think you can do this as a one liner. Well two one liners.
Your error is dictionary does not have a method named "value", it has "values".
I think you can do this as a one liner. Well two one liners.
if isinstance(payload, list): payload = [d for d in payload if not "" in d["payload"].values()] else: payload = {k:v for k, v in payload.items() if v != ""}I still think a more generic solution is better.