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
[Type 3] Publish directly using Datasource/Workbook objects from the Document API #1092
Unless this functionality already exists, it would be helpful to directly use created Datasource/Workbook objects from the Document API as the source when publishing content via TSC. Currently, you have to pass a filepath or a file object, which I haven't found an example of. This would also reduce having to save files to the file system for quick on the fly datasource/workbook creation.
fromtableaudocumentapiimportConnection, Datasourceimporttableauserverclientastscds=Datasource.from_connections(caption="", connections=[some_connection])
# do login magic, get information for publishserver.datasources.publish(
datasource_item=tsc.DatasourceItem(project_id, "My Cool Datasource"),
file=ds, # object? item?mode=server.PublishMode.Overwrite,
connection_credentials=tsc.ConnectionCredentials(username, password),
)
importiofromtableaudocumentapiimportConnection, Datasourceimporttableauserverclientastscds=Datasource.from_connections(caption="", connections=[some_connection])
# do login magic, get information for publish# Save as a file-like object in memorydsblob=io.BytesIO()
ds.save_as(dsblob)
server.datasources.publish(
datasource_item=tsc.DatasourceItem(project_id, "My Cool Datasource"),
file=dsblob,
mode=server.PublishMode.Overwrite,
connection_credentials=tsc.ConnectionCredentials(username, password),
)
Downloading from Tableau Server to such a file-like object by TSC is not yet supported (see #1172), but publishing should work.
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.
Closing as completed. This is already possible today using the recipe nosnilmot posted in this thread: save your Document API Datasource / Workbook object to an io.BytesIO() via save_as(), then pass that BytesIO as the file argument to workbooks.publish() / datasources.publish(). TSC's publish endpoints have accepted file-like objects for a while, so no new TSC surface is needed. If you hit a specific mismatch (e.g., a filetype detection edge case), please open a fresh issue with a reproducer.
Activity
nosnilmot commentedon Jan 13, 2023
This should already be possible:
Downloading from Tableau Server to such a file-like object by TSC is not yet supported (see #1172), but publishing should work.
github-actions commentedon Aug 18, 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.
jacalata commentedon Aug 25, 2026
Closing as completed. This is already possible today using the recipe nosnilmot posted in this thread: save your Document API
Datasource/Workbookobject to anio.BytesIO()viasave_as(), then pass that BytesIO as thefileargument toworkbooks.publish()/datasources.publish(). TSC's publish endpoints have accepted file-like objects for a while, so no new TSC surface is needed. If you hit a specific mismatch (e.g., a filetype detection edge case), please open a fresh issue with a reproducer.