8000 This workaround is no longer needed (#221) · gaoang2148/server-client-python@47c7fb3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 47c7fb3

Browse files
author
Russell Hay
authored
This workaround is no longer needed (tableau#221)
* This workaround is no longer needed The server will sort based on the id by default so that this workaround is no longer needed. We should add documentation that recommends people pass in a supported sort clause manually if they are using other servers * Fix failing test cases
1 parent 0d6d8c1 commit 47c7fb3

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

tableauserverclient/server/pager.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ def __init__(self, endpoint, request_opts=None):
3232
self._count = 0
3333
self._options = RequestOptions()
3434

35-
# Pager assumes deterministic order but solr doesn't guarantee sort order unless specified
36-
if not self._options.sort:
37-
self._options.sort.add(Sort(RequestOptions.Field.Name, RequestOptions.Direction.Asc))
38-
3935
def __iter__(self):
4036
# Fetch the first page
4137
current_item_list, last_pagination_item = self._endpoint(self._options)

test/test_group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def test_populate_users(self):
5454
with open(POPULATE_USERS, 'rb') as f:
5555
response_xml = f.read().decode('utf-8')
5656
with requests_mock.mock() as m:
57-
m.get(self.baseurl + '/e7833b48-c6f7-47b5-a2a7-36e7dd232758/users?pageNumber=1&pageSize=100&sort=name:asc',
57+
m.get(self.baseurl + '/e7833b48-c6f7-47b5-a2a7-36e7dd232758/users?pageNumber=1&pageSize=100',
5858
text=response_xml, complete_qs=True)
5959
single_group = TSC.GroupItem(name='Test Group')
6060
single_group._id = 'e7833b48-c6f7-47b5-a2a7-36e7dd232758'

test/test_pager.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ def test_pager_with_options(self):
5555
page_3 = f.read().decode('utf-8')
5656
with requests_mock.mock() as m:
5757
# Register Pager with some pages
58-
m.get(self.baseurl + "?pageNumber=1&pageSize=1&sort=name:asc", complete_qs=True, text=page_1)
59-
m.get(self.baseurl + "?pageNumber=2&pageSize=1&sort=name:asc", complete_qs=True, text=page_2)
60-
m.get(self.baseurl + "?pageNumber=3&pageSize=1&sort=name:asc", complete_qs=True, text=page_3)
61-
m.get(self.baseurl + "?pageNumber=1&pageSize=3&sort=name:asc", complete_qs=True, text=page_1)
58+
m.get(self.baseurl + "?pageNumber=1&pageSize=1", complete_qs=True, text=page_1)
59+
m.get(self.baseurl + "?pageNumber=2&pageSize=1", complete_qs=True, text=page_2)
60+
m.get(self.baseurl + "?pageNumber=3&pageSize=1", complete_qs=True, text=page_3)
61+
m.get(self.baseurl + "?pageNumber=1&pageSize=3", complete_qs=True, text=page_1)
6262

6363
# Starting on page 2 should get 2 out of 3
6464
opts = TSC.RequestOptions(2, 1)

0 commit comments

Comments
 (0)
0