-
Notifications
You must be signed in to change notification settings - Fork 445
Description
Describe the bug
When I use the download function for a Flow in tableauserverclient under flows_endpoint.py, it fails intermittently.
I am just running it with the same flow id and path every time, it will run successfully a few times, then fail, then run .
I do NOT have this issue with the workbook download function.
Versions
Details of your environment, including:
- Tableau Server version: 2021.3 (API 3.13)
- Python version: 3.11.1
- TSC library version: "^0.25"
To Reproduce
Below is the simple version of the code I am running - anything between <> would be replaced with actual values
If I just keep running this for 1 flow id over and over, it will succeed sometimes and fail sometimes.
import tableauserverclient as TSC
tableau_auth = TSC.PersonalAccessTokenAuth('<token_name>', '<token_secret>', site_id='<site_name>')
server = TSC.Server('https://<servername>.com/', use_server_version=True)
with server.auth.sign_in(tableau_auth):
server.flows.download("<flow_id>","<download_folder>/<flow_name>.tfl")
Results
when it fails I get the error in the attached screenshot.
See the part where it says "nonXMLResponseError: 'b"
from my debugging, I see the response I get is wrapped in single quotes with a b prefix - which in python denotes a byte string.
e.g.
b'
<?xml version=\'1.0\' encoding=\'UTF-8\'?>
<tsResponse xmlns="http://tableau.com/api" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tableau.com/api http://tableau.com/api/ts-api-3.13.xsd">
...<rest of xml here>...
<tags/>
</flow>
</tsResponse>
'
