Skip to content

Commit

Permalink
revert!: revert removed fixes for attrs (#974)
Browse files Browse the repository at this point in the history
* return back fix

* return back Delta fix

* make check like Delta

* Update attrs_utils.py
  • Loading branch information
Damego committed Jul 26, 2022
1 parent 58ad9e3 commit 1c7e5b8
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions interactions/api/models/attrs_utils.py
Expand Up @@ -50,9 +50,23 @@ def __init__(self, kwargs_dict: dict = None, /, **other_kwargs):
if value is not None and attrib.metadata.get("add_client"):
if isinstance(value, list):
for item in value:
item["_client"] = client
if isinstance(item, dict):
item["_client"] = client
elif isinstance(item, DictSerializerMixin):
item._client = client
else:
value["_client"] = client
if isinstance(value, dict):
value["_client"] = client
elif isinstance(value, DictSerializerMixin):
value._client = client

# make sure json is recursively handled
if isinstance(value, list):
self._json[attrib_name] = [
i._json if isinstance(i, DictSerializerMixin) else i for i in value
]
elif isinstance(value, DictSerializerMixin):
self._json[attrib_name] = value._json # type: ignore

passed_kwargs[attrib_name] = value

Expand Down

0 comments on commit 1c7e5b8

Please sign in to comment.