Description
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.
from tableaudocumentapi import Connection, Datasource
import tableauserverclient as tsc
ds = Datasource.from_connections(caption="", connections=[some_connection])
# do login magic, get information for publish
server.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),
)
Description
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.