chembl / chembl_webresource_client

Official Python client for accessing ChEMBL API
https://www.ebi.ac.uk/chembl/api/data/docs
Other
360 stars 95 forks source link

Substructure Search Returning Error #113

Closed jessicastacey closed 2 years ago

jessicastacey commented 2 years ago

When I am performing the command:

from chembl_webresource_client.new_client import new_client
substructure = new_client.substructure
res = substructure.filter(chembl_id="CHEMBL25")
res

I get the error message:

HttpApplicationError: Error for url https://www.ebi.ac.uk/chembl/api/data/substructure.json, server response: {"error_message": "function mol_adjust_query_properties(unknown, unknown) does not exist\nLINE 1: ... U0.\"molregno\" FROM \"compound_mols\" U0 WHERE (m@> mol_adjust...\n ^\nHINT: No function matches the given name and argument types. You might need to add explicit type casts.\n", "traceback": "Traceback (most recent call last):\n\n File \"/opt/conda/envs/chembl-webservices-py3/lib/python3.8/site-packages/django/db/backends/utils.py\", line 84, in _execute\n return self.cursor.execute(sql, params)\n\npsycopg2.errors.UndefinedFunction: function mol_adjust_query_properties(unknown, unknown) does not exist\nLINE 1: ... U0.\"molregno\" FROM \"compound_mols\" U0 WHERE (m@> mol_adjust...\n ^\nHINT: No function matches the given name and argument types. You might need to add explicit type casts.\n\n\n\nThe above exception was the direct cause of the following exception:\n\n\nTraceback (most recent call last):\n\n File \"/chembl_ws_py3/src/chembl_webservices/core/resource.py\", line 441, in handle\n count = sorted_objects.count() if not isinstance(sorted_objects, list) else len(sorted_objects)\n\n File \"/opt/conda/envs/chembl-webservices-py3/lib/python3.8/site-packages/django/db/models/query.py\", line 392, in count\n return self.query.get_count(using=self.db)\n\n File \"/opt/conda/envs/chembl-webservices-py3/lib/python3.8/site-packages/django/db/models/sql/query.py\", line 504, in get_count\n number = obj.get_aggregation(using, ['count'])['count']\n\n File \"/opt/conda/envs/chembl-webservices-py3/lib/python3.8/site-packages/django/db/models/sql/query.py\", line 489, in get_aggregation\n result = compiler.execute_sql(SINGLE)\n\n File \"/opt/conda/envs/chembl-webservices-py3/lib/python3.8/site-packages/django/db/models/sql/compiler.py\", line 1140, in execute_sql\n cursor.execute(sql, params)\n\n File \"/opt/conda/envs/chembl-webservices-py3/lib/python3.8/site-packages/django/db/backends/utils.py\", line 99, in execute\n return super().execute(sql, params)\n\n File \"/opt/conda/envs/chembl-webservices-py3/lib/python3.8/site-packages/django/db/backends/utils.py\", line 67, in execute\n return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)\n\n File \"/opt/conda/envs/chembl-webservices-py3/lib/python3.8/site-packages/django/db/backends/utils.py\", line 76, in _execute_with_wrappers\n return executor(sql, params, many, context)\n\n File \"/opt/conda/envs/chembl-webservices-py3/lib/python3.8/site-packages/django/db/backends/utils.py\", line 84, in _execute\n return self.cursor.execute(sql, params)\n\n File \"/opt/conda/envs/chembl-webservices-py3/lib/python3.8/site-packages/django/db/utils.py\", line 89, in exit\n raise dj_exc_value.with_traceback(traceback) from exc_value\n\n File \"/opt/conda/envs/chembl-webservices-py3/lib/python3.8/site-packages/django/db/backends/utils.py\", line 84, in _execute\n return self.cursor.execute(sql, params)\n\ndjango.db.utils.ProgrammingError: function mol_adjust_query_properties(unknown, unknown) does not exist\nLINE 1: ... U0.\"molregno\" FROM \"compound_mols\" U0 WHERE (m@> mol_adjust...\n ^\nHINT: No function matches the given name and argument types. You might need to add explicit type casts.\n\n"}

This is my installed version and it is running on python version 3.9.7 chembl-webresource-client 0.10.7 pypi_0 pypi

Other requests are working fine i.e.

molecule = new_client.molecule
mols = molecule.filter(pref_name__iexact='aspirin')
mols
cesc-fabregas2020 commented 2 years ago

I run into the same issue.

eloyfelix commented 2 years ago

Sorry the substructure functionality has been a bit unstable lately. We've been having big infrastructure changes and we are working on a better way to provide a more stable substructure search.

eloyfelix commented 2 years ago

the substructure search should be working better now after some backend improvements we've been working on.