trinodb / trino-python-client

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

printing http response as info in client.py cancel() #215

Closed EugeneChung closed 2 years ago

EugeneChung commented 2 years ago

Hi all.

[INFO|client.py:807] 2022-08-11 10:01:04,392 > <Response [204]>

https://github.com/trinodb/trino-python-client/blame/e26027375326a1e0fc8a472d242af75b4e6049bc/trino/client.py#L807

Is it intended or should it be debug level?

hashhar commented 2 years ago

It doesn't seem to be intended. Would you like to send a PR?

EugeneChung commented 2 years ago

@hashhar Okay~

EugeneChung commented 2 years ago

FYI, it happens because of #195 . Calling sqlalchemy result.scalar() from trino/sqlalchemy/dialect.py#_get_server_version_info() closes the cursor which is not finished, and it causes cancelling of SELECT version() query.

guyco33 commented 2 years ago

FYI, it happens because of #195 . Calling sqlalchemy result.scalar() from trino/sqlalchemy/dialect.py#_get_server_version_info() closes the cursor which is not finished, and it causes cancelling of SELECT version() query.

@hashhar @EugeneChung https://github.com/trinodb/trino-python-client/pull/210 fixes it