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

Use single quotes in database queries #770

Closed
wants to merge 1 commit into from

Conversation

nsoranzo
Copy link

@nsoranzo nsoranzo commented Feb 19, 2025

Fix the following error when using SQLite 3.44.1:

sqlite3.OperationalError: no such column: "latimeria chalumnae" - should this be a string literal in single-quotes?

Successfully tested with $ pytest tests/test_ncbiquery.py

Fix the following error when using SQLite 3.44.1:

```
sqlite3.OperationalError: no such column: "latimeria chalumnae" - should this be a string literal in single-quotes?
```
@conchoecia
Copy link

I ran into the same issue, this is the relevant section of the traceback from a simple query:

    taxid2name = ncbi.get_taxid_translator([9606, 9443])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/path/to/lib/python3.12/site-packages/ete3/ncbi_taxonomy/ncbiquery.py", line 268, in get_taxid_translator
    result = self.db.execute(cmd)
             ^^^^^^^^^^^^^^^^^^^^
sqlite3.OperationalError: no such column: "9443" - should this be a string literal in single-quotes?

This is my sqlite version:

conda list sqlite

# Name                    Version                   Build  Channel
libsqlite                 3.49.1               hee588c1_1    conda-forge

@jordibc
Copy link
Contributor

jordibc commented Mar 6, 2025

Thanks @nsoranzo and @conchoecia !
This is indeed related with a change of behavior of sqlite3. We have just updated ete to fix it. Hopefully it works for you now, if not, feel free to reopen this issue.

@jordibc jordibc closed this Mar 6, 2025
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

Successfully merging this pull request may close these issues.

3 participants