Closed
Description
I get a an AttributeError
when fetching a population using ApiClient.get_population
. The error only occurs when parsing the API response as a Population resource (returning a python dictionary works fine).
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_6900/2240636668.py in <module>
4
----> 5 client.get_population(expID,"5e0b82d48b123104d0476ad6",as_dict=False)
C:\anaconda3\envs\autotailor\lib\site-packages\cellengine\utils\api_client\APIClient.py in get_population(self, experiment_id, _id, name, as_dict)
476 if as_dict:
477 return population
--> 478 return Population.from_dict(population)
479
480 def post_population(self, experiment_id, population: Dict) -> Population:
C:\anaconda3\envs\autotailor\lib\site-packages\dataclasses_json\api.py in from_dict(cls, kvs, infer_missing)
80 *,
81 infer_missing=False) -> A:
---> 82 return _decode_dataclass(cls, kvs, infer_missing)
83
84 def to_dict(self, encode_json=False) -> Dict[str, Json]:
C:\anaconda3\envs\autotailor\lib\site-packages\dataclasses_json\core.py in _decode_dataclass(cls, kvs, infer_missing)
206 field_value)
207
--> 208 return cls(**init_kwargs)
209
210
C:\anaconda3\envs\autotailor\lib\site-packages\cellengine\resources\population.py in __init__(self, name, gates, parent_id, terminal_gate_gid, _id, experiment_id, unique_name)
C:\anaconda3\envs\autotailor\lib\site-packages\cellengine\utils\dataclass_mixin.py in __set__(self, instance, value)
41 setattr(instance, f"_{self.attr}", None)
42 else:
---> 43 raise AttributeError(
44 f"Property '{self.attr}' is required for object '{self.owner}'."
45 )
AttributeError: Property 'unique_name' is required for object 'Population'.