trinodb / trino-python-client

Python client for Trino
Apache License 2.0
327 stars 163 forks source link

Sqlalchemy transactions with Repeatable_read #481

Open StephenOTT opened 3 weeks ago

StephenOTT commented 3 weeks ago

Expected behavior

dding a isolation level in the SA Session causes a failure when using any of the levels with underscores.

Trino client is removing the underscore, but then SA requires the underscore in downstream methods for a enum lookup.

Looking at the tests, it seems like it was not tested against the isolation levels with underscores.

Thanks.

Actual behavior

Fails

Steps To Reproduce

Use isolation level REPEATABLE_READ with SA

Log output

No response

Operating System

Windoss

Trino Python client version

Latest

Trino Server version

429

Python version

3.9

Are you willing to submit PR?

hashhar commented 3 weeks ago

Thank you for the report and being willing to submit a PR. I'll take a look at the PR once it's available.

StephenOTT commented 3 weeks ago

Hey @hashhar can you confirm for me: are transactions supported in the Postgres connector?

The docs seem to allude yes, but some ~random issues in this repo seem to indicate no.

hashhar commented 2 weeks ago

No. Transactions are emulated for the Hive connector only as far as I remember.

cc: @mosabua Maybe we should clarify this in the docs + check what's the long term plan around transactions - will they go away eventually since we can only try to "emulate" them?

StephenOTT commented 2 weeks ago

At the very least to add a big warning on this repos readme in the transaction section. :)