Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
guillaume-gricourt opened this issue Feb 16, 2024 · 2 comments
Open

Comments

@guillaume-gricourt
Copy link
Member

guillaume-gricourt commented Feb 16, 2024

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

@breakthewall
Copy link
Member

Can you describe how have you reproduced the error locally?

@guillaume-gricourt
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants