[Solved] Flat a list of containing only one dict


You can flatten the internal dict and update it back to the original dict.
Eg.,

product = d.pop("product")[0]
flattened = {f"product.{key}": value for key, value in product.items()}
d.update(flattened)

This should do the trick.

1

solved Flat a list of containing only one dict