Closed benrifkind closed 1 year ago
It looks like client_tags was was initially implemented on a per query basis but then it was changed. So probably I'm missing something. From my reading of the comment, I guess per the name client_tags
is meant to be used on a per client basis. So Trino does not support something like query tags...
Seems like the suggested thing to do is just to create a connection per query.
https://github.com/trinodb/trino-python-client/pull/265#pullrequestreview-1141127795
Describe the feature
Currently you can only specify client_tags when you create a Trino Connection. I want to be able to update the tags whenever I run cursor.execute. My workflow is generally to create one cursor from one connection. And then use cursor.execute multiple times. Each query that I send with execute is different and so I want to tag it differently for tracking purposes.
Describe alternatives you've considered
One alternative is just to add
additional_http_headers
to theCursor.execute
method and pass it through to thetrino.client.TrinoQuery.execute
method. Then the user can update the tags by setting the header key "X-Trino-Client-Tags"Are you willing to submit PR?