Skip to content

Commit 1c7e5b8

Browse files
authored
revert!: revert removed fixes for attrs (#974)
* return back fix * return back Delta fix * make check like Delta * Update attrs_utils.py
1 parent 58ad9e3 commit 1c7e5b8

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

interactions/api/models/attrs_utils.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,23 @@ def __init__(self, kwargs_dict: dict = None, /, **other_kwargs):
5050
if value is not None and attrib.metadata.get("add_client"):
5151
if isinstance(value, list):
5252
for item in value:
53-
item["_client"] = client
53+
if isinstance(item, dict):
54+
item["_client"] = client
55+
elif isinstance(item, DictSerializerMixin):
56+
item._client = client
5457
else:
55-
value["_client"] = client
58+
if isinstance(value, dict):
59+
value["_client"] = client
60+
elif isinstance(value, DictSerializerMixin):
61+
value._client = client
62+
63+
# make sure json is recursively handled
64+
if isinstance(value, list):
65+
self._json[attrib_name] = [
66+
i._json if isinstance(i, DictSerializerMixin) else i for i in value
67+
]
68+
elif isinstance(value, DictSerializerMixin):
69+
self._json[attrib_name] = value._json # type: ignore
5670

5771
passed_kwargs[attrib_name] = value
5872

0 commit comments

Comments
 (0)