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
Issue with Downloading Large Views from Tableau Server to CSV #1374
Describe the bug
I'm encountering an issue when trying to download a view that is around 200 MB in size. My script works perfectly for smaller files (5 MB or 10 MB), but it keeps running indefinitely and doesn't write data into the CSV file for the larger view.
The script successfully logs "CSV populated," indicating that server.views.populate_csv completes, but the file is not written for larger views.
Here's the code I'm using:
def download_file(client, server, content_url, output_file, region):
# NOTE: Monkey patched TSC.RequestOptions.Field class
# since the contentUrl filter parameter was not supported
setattr(TSC.RequestOptions.Field, 'ContentURL', 'contentUrl')
req_option = TSC.RequestOptions()
req_option.filter.add(TSC.Filter(TSC.RequestOptions.Field.ContentURL,
TSC.RequestOptions.Operator.Equals,
content_url))
logger.info('Fetching views...')
views, pagination_item = server.views.get(req_option)
logger.info(f'Views fetched: {len(views)}')
if len(views) == 1:
only_matched_index = 0
view = views[only_matched_index]
logger.info('Populating CSV...')
server.views.populate_csv(view, TSC.CSVRequestOptions(maxage = 5))
logger.info('CSV populated.')
with open(output_file, 'wb') as f:
f.write(b''.join(view.csv))
logger.info(f"CSV DATA WRITTEN TO the {output_file}")
OUTPUT:
INFO:main:Fetching views...
INFO:main:Views fetched: 1
INFO:main:Populating CSV...
INFO:main:CSV populated.
Could anyone suggest what might be going wrong with handling larger views? Are there any additional steps or considerations when dealing with larger files in Tableau Server that I might be missing?
Any insights or suggestions would be greatly appreciated!
Hm, not sure I've tried this. Most likely the problem is in the library here, and the request is timing out - there's no logic here to extend the session. I'll try and reproduce it to see exactly what happens.
I would also consider changing the line f.write(b''.join(view.csv)). Its a nifty one-liner if the data is small enough and can easily fit into RAM, but you could run into problems with bigger files, as well as not being able to troubleshoot as easily. You could do this for example:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. If this is still relevant, please comment to keep it open.
Update — an in-flight PR (#1817) increases the streaming chunk size for CSV and Excel view downloads, which should reduce total transfer time for large views and may resolve some timeout cases. It does not add session-extension logic, so genuinely long-running downloads on very large views may still time out. If either of you can test against that branch and report whether your download completes, that would help decide next steps here.
Activity
jacalata commentedon May 22, 2024
Hm, not sure I've tried this. Most likely the problem is in the library here, and the request is timing out - there's no logic here to extend the session. I'll try and reproduce it to see exactly what happens.
abhishek7575-spec commentedon May 23, 2024
@jacalata Thank you for looking into this and for trying to reproduce the issue. Looking forward to hearing back from you.
jorwoods commentedon May 30, 2024
@abhishek7575-spec in v0.30, ContentUrl is absolutely available.
I would also consider changing the line
f.write(b''.join(view.csv)). Its a nifty one-liner if the data is small enough and can easily fit into RAM, but you could run into problems with bigger files, as well as not being able to troubleshoot as easily. You could do this for example:It would give you log output so you can see that its still working and not have to load the entire file into RAM at once.
SenthamizhCSS commentedon Sep 15, 2024
@abhishek7575-spec : I'm also facing the same issue...Were you able to get this resolved?
fix: increase streaming chunk size for CSV and Excel view downloads
github-actions commentedon Jul 28, 2026
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. If this is still relevant, please comment to keep it open.
fix: unify streaming download chunk size across Views, CustomViews, a…
jacalata commentedon Jul 31, 2026
Update — an in-flight PR (#1817) increases the streaming chunk size for CSV and Excel view downloads, which should reduce total transfer time for large views and may resolve some timeout cases. It does not add session-extension logic, so genuinely long-running downloads on very large views may still time out. If either of you can test against that branch and report whether your download completes, that would help decide next steps here.