trino-python-client
trino-python-client copied to clipboard
Client send empty session when user do not set session
Expected behavior
client only send session when session is set by users
Actual behavior
client send empty session if no session is set by users
in client, it doesn't check if session exists
- if self._client_session.properties:
headers[constants.HEADER_SESSION] = ",".join(
#
namemust not contain="{}={}".format(name, urllib.parse.quote(str(value))) for name, value in self._client_session.properties.items() )
Steps To Reproduce
can be reproduced by init a connection and send a request. or add a unit test in test_client
def test_request_session_properties_headers(mock_get_and_post):
get, post = mock_get_and_post
req = TrinoRequest(
host="coordinator",
port=8080,
client_session=ClientSession(
user="test_user",
)
)
def assert_headers(headers):
assert constants.HEADER_SESSION not in headers
Log output
No response
Operating System
amazon linux 2
Trino Python client version
0.328.0
Trino Server version
449
Python version
3.7.16
Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
Why is this a problem?
Feel free to send a PR to omit the header altogether if you want.
Closing since this is not considered an issue.