server-client-python icon indicating copy to clipboard operation
server-client-python copied to clipboard

Workbook API Reference naming convention is off in Example for get()

Open acpana opened this issue 9 years ago • 2 comments

In our API reference, under the Workbook section, we demo how to use get() to acquire all the workbooks on the server. The code for that example looks like the one below. The last 2 lines are the matter.

import tableauserverclient as TSC
tableau_auth = TSC.TableauAuth('username', 'password', site_id='site')
server = TSC.Server('http://servername')

with server.auth.sign_in(tableau_auth):
  all_workbook_items, pagination_item = server.workbooks.get()
  print([workbook.name for workbook in all_workbooks])

There seems to be a typo if the code snippet above is to be a standalone example. The second to last assigns all the workbook items to the variable all_workbook_items, however, in the last line we reference to that assignment with the variable all_workbooks, which was not defined anywhere in the code snippet.

acpana avatar May 25 '17 19:05 acpana

It's also technically not 'all workbooks' just the first 100

t8y8 avatar May 26 '17 16:05 t8y8

Good catch. I'll update the name of the variable in the snippet (and add a comment about it being just the first 100).

d45 avatar May 31 '17 21:05 d45