rest-api-samples icon indicating copy to clipboard operation
rest-api-samples copied to clipboard

"Move workbooks" sample doesn't work for large workbooks

Open vikpos opened this issue 6 years ago • 2 comments

Hi team,

I spotted an issue in this sample script: https://github.com/tableau/rest-api-samples/blob/master/python/move_workbook_sites.py

When running it with a large workbook (over 64MB) the script fails with: Traceback (most recent call last): File "C:\Python27\Lib\site-packages\move_DS_sample.py", line 405, in main() File "C:\Python27\Lib\site-packages\move_DS_sample.py", line 392, in main workbook_content, dest_project_id) File "C:\Python27\Lib\site-packages\move_DS_sample.py", line 299, in publish_workbook upload_id = start_upload_session(server, site_id, auth_token) File "C:\Python27\Lib\site-packages\move_DS_sample.py", line 173, in start_upload_session _check_status(server_response, 201) File "C:\Python27\Lib\site-packages\move_DS_sample.py", line 106, in _check_status raise ApiCallError(error_message) main.ApiCallError: 401002: Unauthorized Access - Invalid authentication credentials were provided.

I found this happens because of line 288: upload_id = start_upload_session(server, site_id, auth_token)

the code should be: upload_id = start_upload_session(server, auth_token, site_id)

Otherwise it uses "site id" as auth token and fails... Could you please fix? NB: Same issue could be affecting other samples...

vikpos avatar May 30 '18 13:05 vikpos

This looks like a clear-cut fix to me. Any concerns from @RussTheAerialist or @irwando ?

aaroncarey avatar Jun 01 '18 23:06 aaroncarey

Confirming this issue is still not resolved in the sample script

alibbird avatar Mar 21 '20 05:03 alibbird