Skip to content

rpthermo: Query must be a string unless using sqlalchemy #35

@guillaume-gricourt

Description

@guillaume-gricourt

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions