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
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),
)