Skip to content

Sign in with http_options set will fail #1116

@bcantoni

Description

@bcantoni

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:

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

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions