Pymatgen error, regarding

Dear Users and developers,
I executed code on google colab which works fine but the same doesn’t work with Jupyter notebook
In colab, I can see the pymatgen version pymatgen-2022.0.17

with MPRester(“api_key”) as m:
** #,“material_id”:{“$in”:[“mp-1522”,“mp-555322”,“mp-2099”,“mp-556911”,“mp-22862”,“mp-23193”,“mp-23251”,“mp-22898”]}**
** criteria = {“structure”: {‘$exists’: True}}**
** c = m.query(criteria=criteria,properties=[“material_id”,“nsites”,“nelements”,“num_sites”,“structure”,“primitive_structure”,“e_above_hull”])**
** df=pd.json_normalize(c)**
** #print(df.head)**

In Jupyter, it mentioned the api is outdated, so I changed the key and changed the “m.query” to “m.summary.search”
Still It gave the error
TypeError: search() got an unexpected keyword argument ‘criteria’
From previous responses, I understood that “criteria” is NOT anymore included but I am not sure what has been reformed here. The same code works well on google colab.

Next, in colab, I after few hours of execution, I get the following error.
MPRestError Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/pymatgen/ext/matproj.py in _make_request(self, sub_url, payload, method, mp_decode)
** 252 **
→ 253 raise MPRestError(f"REST query returned with error status code {response.status_code}")
** 254 **

MPRestError: REST query returned with error status code 502

During handling of the above exception, another exception occurred:

MPRestError Traceback (most recent call last)
4 frames
/usr/local/lib/python3.7/dist-packages/pymatgen/ext/matproj.py in _make_request(self, sub_url, payload, method, mp_decode)
** 255 except Exception as ex:**
** 256 msg = f"{str(ex)}. Content: {response.content}" if hasattr(response, “content”) else str(ex)**
→ 257 raise MPRestError(msg)
** 258 **
** 259 def get_database_version(self):**

MPRestError: REST query returned with error status code 502. Content: b’\r\n502 Bad Gateway\r\n\r\n

502 Bad Gateway

\r\n
cloudflare\r\n\r\n\r\n’

Is the above error a runtime error or is it because “too much data is being requested in one query

Any quick suggestions and how to reform the code further will help me a lot here.

Regards
Rahul