Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
revert
  • Loading branch information
bupt-wenxiaole committed Feb 23, 2024
commit 3e5e296f3a90d5390d0ac25680ace28cc4868d74
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,7 @@ def _to_rest_object(self, **kwargs: Any) -> dict:
"partition_keys": json.dumps(self.partition_keys)
if self.partition_keys is not None
else self.partition_keys,
"identity": self.identity._to_dict()
if self.identity and not isinstance(self.identity, Dict)
else None,
"identity": get_rest_dict_for_node_attrs(self.identity),
"resources": get_rest_dict_for_node_attrs(self.resources),
}
)
Expand Down Expand Up @@ -481,9 +479,8 @@ def _from_rest_object_to_init_params(cls, obj: dict) -> Dict:

if "partition_keys" in obj and obj["partition_keys"]:
obj["partition_keys"] = json.dumps(obj["partition_keys"])

if "identity" in obj and obj["identity"]:
obj["identity"] = _BaseJobIdentityConfiguration._load(obj["identity"])
obj["identity"] = _BaseJobIdentityConfiguration._from_rest_object(obj["identity"])
return obj

def _build_inputs(self) -> Dict:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,6 @@ def _to_rest_object(self) -> RestJobResourceConfiguration:
shm_size=self.shm_size,
)

@classmethod
def _from_dict(cls, dct: dict):
"""Convert a dict to an Input object."""
obj = cls(**dict(dct.items()))
return obj

@classmethod
def _from_rest_object(cls, obj: Optional[RestJobResourceConfiguration]) -> Optional["JobResourceConfiguration"]:
if obj is None:
Expand Down