You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
server.workbooks.refresh not accepting the correct parameter #562
So my code is refreshing data sources and workbooks, I am able to refresh the data source with no issues doing: all_datasources, pagination_item = server.datasources.get() try: location = [datasource.name for datasource in all_datasources].index(dataSourceName) datasource = all_datasources[location] refreshData = server.datasources.refresh(datasource)
BUT applying the same logic to: all_workbooks, pagination_item = server.workbooks.get() try: location = [workbook.name for workbook in all_workbooks].index(workbookName) workbook = all_workbooks[location] workbook2 = server.workbooks.refresh(workbook)
i get this error: 404006: Resource Not Found Workbook '<tableauserverclient.models.workbook_item.WorkbookItem object at 0x000002970D233358>' could not be found.
and when looking at workbook = server.workbooks.refresh() this happens: TypeError: refresh() missing 1 required positional argument: 'workbook_id'
@nicoleLaczny also, I found that calling server.workbooks.get or server.datasources.get doesn't necessarily return all items, only the first 100, as it paginates.
What you should do instead is something like: all_workbooks = list(TSC.Pager(server.workbooks))
Activity
jorwoods commentedon Feb 6, 2020
@nicoleLaczny I ran into exactly the same issue. I just created #563 to resolve this problem while still allowing backward compatibility.
jorwoods commentedon Feb 6, 2020
@nicoleLaczny also, I found that calling
server.workbooks.getorserver.datasources.getdoesn't necessarily return all items, only the first 100, as it paginates.What you should do instead is something like:
all_workbooks = list(TSC.Pager(server.workbooks))