This is the error I get. Thank you for your prompt reply.
ValidationError Traceback (most recent call last)
in
2 battery_list2 = pd.DataFrame()
3 with MPRester(“11111111111111111111111”) as mpr:
----> 4 battery_list = mpr.insertion_electrodes.search_electrode_docs(“Li”, all_fields=True)
5 battery_list2 = battery_list2.append(battery_list, ignore_index=True)
6 battery_list2.head()
~\AppData\Roaming\Python\Python37\site-packages\mp_api\routes\electrodes\client.py in search_electrode_docs(self, working_ion, formula,
elements, exclude_elements, max_delta_volume, average_voltage, capacity_grav, capacity_vol, energy_grav, energy_vol, fracA_charge,
fracA_discharge, stability_charge, stability_discharge, num_steps, max_voltage_step, sort_fields, num_chunks, chunk_size, all_fields, fields)
109 }
110
→ 111 return super().search(**query_params)
~\AppData\Roaming\Python\Python37\site-packages\mp_api\core\client.py in search(self, num_chunks, chunk_size, all_fields, fields, **kwargs)
436 fields=fields,
437 chunk_size=chunk_size,
→ 438 num_chunks=num_chunks,
439 )
440
~\AppData\Roaming\Python\Python37\site-packages\mp_api\core\client.py in _get_all_documents(self, query_params, all_fields, fields, chunk_size, num_chunks)
459 query_params[“limit”] = chunk_size
460
→ 461 results = self._query_resource(query_params, fields=fields,)
462
463 # if we have all the results in a single page, return directly
~\AppData\Roaming\Python\Python37\site-packages\mp_api\core\client.py in _query_resource(self, criteria, fields, suburl, use_document_model)
281 # the client does not handle this in a particularly smart way currently
282 if self.document_model and use_document_model:
→ 283 data[“data”] = [self.document_model.parse_obj(d) for d in data[“data”]] # type: ignore
284
285 return data
~\AppData\Roaming\Python\Python37\site-packages\mp_api\core\client.py in (.0)
281 # the client does not handle this in a particularly smart way currently
282 if self.document_model and use_document_model:
→ 283 data[“data”] = [self.document_model.parse_obj(d) for d in data[“data”]] # type: ignore
284
285 return data
~\SoftwaresInstalled\Anaconda\envs\tf1\lib\site-packages\pydantic\main.cp37-win_amd64.pyd in pydantic.main.BaseModel.parse_obj()
~\SoftwaresInstalled\Anaconda\envs\tf1\lib\site-packages\pydantic\main.cp37-win_amd64.pyd in pydantic.main.BaseModel.init()
ValidationError: 1 validation error for InsertionElectrodeDoc
electrode_object
value is not a valid dict (type=type_error.dict)