**Describe the bug** Signing in to a server when any http_options have been set in the TSC.Server object will result in an exception: KeyError: 'X-TableauServerClient-Version' **Versions** TSC library versions v0.21 and v0.22 have the issue. Version v0.19.1 works correctly. **To Reproduce** Include any http_options while creating the TSC.Server object: ````py server = TSC.Server('https://10ax.online.tableau.com', use_server_version=True, http_options={"verify": False}) server.auth.sign_in(tableau_auth) ```` Workaround: use TSC v0.19.1 instead. **Results** ````py Traceback (most recent call last): File "/Users/brian/github/server-client-python/pat-login.py", line 17, in <module> server = TSC.Server('https://10ax.online.tableau.com', use_server_version=True, http_options={"verify": False}) File "/Users/brian/github/server-client-python/tableauserverclient/server/server.py", line 101, in __init__ self.add_http_version_header() File "/Users/brian/github/server-client-python/tableauserverclient/server/server.py", line 112, in add_http_version_header if not self._http_options[client_version_header]: KeyError: 'X-TableauServerClient-Version' ````
Activity
t8y8 commentedon Sep 22, 2022
https://github.com/tableau/server-client-python/pull/1075/files#diff-baff71702721406ed2f46c06b280ce8c2d463b77a5aa33badcb548d93ca31a7aR110 is the commit where it broke, I think you can just change it to...
That's a slightly more idiomatic way to do a key check in a dict.
The following works too, if you want the smallest possible fix:
It's probably better to put those module level constants as ALL_CAPS or _PREFIXED given they're not really useful outside this context
bcantoni commentedon Sep 26, 2022
I tested with current development branch with Jac's fix merged and it looks correct now.
bcantoni commentedon Sep 28, 2022
This is fixed now in release 0.23.