question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trino 0.317 broke compatibility with SQLAlchemy 1.3.24

See original GitHub issue

Expected behavior

Calling _get_server_version_info works with SQLAlchemy 1.3.24.

Actual behavior

Calling _get_server_version_info throws an AttributeError

    def _get_server_version_info(self, connection: Connection) -> Any:
        query = "SELECT version()"
        try:
            res = connection.execute(sql.text(query))
>           version = res.scalar_one()
E           AttributeError: 'ResultProxy' object has no attribute 'scalar_one'

venv/lib/python3.10/site-packages/trino/sqlalchemy/dialect.py:337: AttributeError

Steps To Reproduce

I believe 7c97873af5a3bf390d8e4d75721b6c60e1a085e9 is the culprit here.

Log output

see above

Operating System

ubuntu in github actions

Trino Python client version

0.317

Trino Server version

n/a

Python version

repro’d on both 3.7 and 3.10

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
hsheth2commented, Oct 10, 2022

sqlalchemy~=1.3 is the same as sqlalchemy>=1.3, ==1.*. As such, it actually does allow installing 1.4.x (stack overflow)

Adding a test matrix in CI would probably be a great fix.

1reaction
mdesmetcommented, Oct 7, 2022

@hashhar , @ebyhr : I suggest we add all supported sqlalchemy major versions to a CI test matrix in order to avoid such breaking changes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The 1.3.24 release broke Python 3.4 compatibility · Issue #6168
The 1.3.x line continues to work with Python 3.4 or it is explicitly declared as incompatible. To Reproduce. import sqlalchemy.
Read more >
1.3 Changelog — SQLAlchemy 2.0 Documentation
Fixed issue in the area of where loader options such as selectinload() interact with the baked query system, such that the caching of...
Read more >
sqlalchemy-trino - PyPI
sqlalchemy -trino was developed as Trino (f.k.a PrestoSQL) dialect for SQLAlchemy. Since trinodb/trino-python-client#81, all code of sqlalchemy-trino is ...
Read more >
getting error with SQLAlchemy 1.3.24 and postgresql backend
solved the issue by removing .execution_options(schema_translate_map={None: prjkey}),. This did not give problem with SQLAlchemy 1.4 but ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found