Skip to content
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions tableauserverclient/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import requests

_PRODUCT_TO_REST_VERSION = {
'2018.1': '3.0',
'10.0': '2.3',
'9.3': '2.2',
'9.2': '2.1',
Expand All @@ -30,7 +31,7 @@ def __init__(self, server_address, use_server_version=False):
self._session = requests.Session()
self._http_options = dict()

self.version = "2.3"
self.version = "3.0"
Copy link
Copy Markdown
Contributor

@graysonarts graysonarts Jun 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't change this one either. 2.3 is the oldest version we support, so we want to default to the oldest version unless specifically detected to be earlier.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Russ,

So if I remove this change and initialise the server with use_server_version = True. then it works. Is that how I'm supposed to do it?

Do we expect people to know that or is it documented?
Marc

self.auth = Auth(self)
self.views = Views(self)
self.users = Users(self)
Expand Down Expand Up @@ -76,7 +77,7 @@ def _get_legacy_version(self):
def _determine_highest_version(self):
try:
old_version = self.version
self.version = "2.4"
self.version = "3.0"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't change this one. The endpoint we are using to check the highest version was introduced in 2.4, so we need to force it to use that version to cover old versions.

version = self.server_info.get().rest_api_version
except ServerInfoEndpointNotFoundError:
version = self._get_legacy_version()
Expand Down