Skip to content

[Type 3] Publish directly using Datasource/Workbook objects from the Document API #1092

@eschranz

Description

@eschranz

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions