"TypeError: Query must be a string unless using sqlalchemy" issue
I did not have this problem before, and I'm rather uncertain what to do here, I did try upgrading/downgrading SQLAlchemy just in case. Basically, whether I run this using equilibrator_api
>>> from equilibrator_api import ComponentContribution
>>> cc=ComponentContribution()
or this using equilibrator_assets
>>> from equilibrator_assets.local_compound_cache import LocalCompoundCache
I get a similar error about using SQL:
self._synonyms = pd.read_sql(
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/seaver/anaconda3/envs/msd-env/lib/python3.11/site-packages/equilibrator_api/component_contribution.py", line 148, in __init__
self.ccache = ccache or create_compound_cache_from_zenodo()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/seaver/anaconda3/envs/msd-env/lib/python3.11/site-packages/equilibrator_cache/api.py", line 70, in create_compound_cache_from_zenodo
return create_compound_cache_from_sqlite_file(path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/seaver/anaconda3/envs/msd-env/lib/python3.11/site-packages/equilibrator_cache/api.py", line 49, in create_compound_cache_from_sqlite_file
return CompoundCache(create_engine(f"sqlite:///{path}"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/seaver/anaconda3/envs/msd-env/lib/python3.11/site-packages/equilibrator_cache/compound_cache.py", line 80, in __init__
self._synonyms = pd.read_sql(
^^^^^^^^^^^^
File "/home/seaver/anaconda3/envs/msd-env/lib/python3.11/site-packages/pandas/io/sql.py", line 706, in read_sql
return pandas_sql.read_query(
^^^^^^^^^^^^^^^^^^^^^^
File "/home/seaver/anaconda3/envs/msd-env/lib/python3.11/site-packages/pandas/io/sql.py", line 2739, in read_query
cursor = self.execute(sql, params)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/seaver/anaconda3/envs/msd-env/lib/python3.11/site-packages/pandas/io/sql.py", line 2671, in execute
raise TypeError("Query must be a string unless using sqlalchemy.")
TypeError: Query must be a string unless using sqlalchemy.
I tried upgrading SQLAlchemy, but pip warns that the version of SQLAlchemy must be between 1.3 and 1.4.
Here's my package list:
equilibrator-api 0.5.1
equilibrator-assets 0.5.0
equilibrator-cache 0.5.4
component-contribution 0.5.2
Thanks Sam