brsynth/rptools

rpthermo: Query must be a string unless using sqlalchemy

guillaume-gricourt opened this issue · 2 comments

An error is thrown by rpthermo

/usr/local/lib/python3.10/site-packages/equilibrator_cache/compound_cache.py:80: UserWarning: pandas only supports SQLAlchemy connectable (engine/connection) or database string URI or sqlite3 DBAPI2 connection. Other DBAPI2 objects are not tested. Please consider using SQLAlchemy.
  self._synonyms = pd.read_sql(
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.10/site-packages/rptools/rpthermo/__main__.py", line 117, in <module>
    _cli()
  File "/usr/local/lib/python3.10/site-packages/rptools/rpthermo/__main__.py", line 45, in _cli
    results = runThermo(
  File "/usr/local/lib/python3.10/site-packages/rptools/rpthermo/rpthermo.py", line 103, in runThermo
    cc = initThermo(
  File "/usr/local/lib/python3.10/site-packages/rptools/rpthermo/rpthermo.py", line 604, in initThermo
    cc = ComponentContribution()
  File "/usr/local/lib/python3.10/site-packages/equilibrator_api/component_contribution.py", line 148, in __init__
    self.ccache = ccache or create_compound_cache_from_zenodo()
  File "/usr/local/lib/python3.10/site-packages/equilibrator_cache/api.py", line 70, in create_compound_cache_from_zenodo
    return create_compound_cache_from_sqlite_file(path)
  File "/usr/local/lib/python3.10/site-packages/equilibrator_cache/api.py", line 49, in create_compound_cache_from_sqlite_file
    return CompoundCache(create_engine(f"sqlite:///{path}"))
  File "/usr/local/lib/python3.10/site-packages/equilibrator_cache/compound_cache.py", line 80, in __init__
    self._synonyms = pd.read_sql(
  File "/usr/local/lib/python3.10/site-packages/pandas/io/sql.py", line 706, in read_sql
    return pandas_sql.read_query(
  File "/usr/local/lib/python3.10/site-packages/pandas/io/sql.py", line 2739, in read_query
    cursor = self.execute(sql, params)
  File "/usr/local/lib/python3.10/site-packages/pandas/io/sql.py", line 2671, in execute
    raise TypeError("Query must be a string unless using sqlalchemy.")

Reproduced locally
Related to brsynth/galaxytools#180 and galaxyproject/tools-iuc#5005

Can you describe how have you reproduced the error locally?

Sure

conda create -n rptools rptools
conda activate rptools

python -m rptools.rpthermo rp_013_0001.xml  output.xml --pH 7.5 --ionic_strength 0.25 --pMg 3.0

rp_013_0001.xml