server-client-python icon indicating copy to clipboard operation
server-client-python copied to clipboard

Can not download datasources that are not in project

Open DaniilBalabanov33N opened this issue 4 years ago • 4 comments

A duplication of https://github.com/tableau/server-client-python/issues/293 but it was closed by the author with no solution provided

For some reason datasources in workbooks can only be found by ID and can not be downloaded

ds = server.datasources.get_by_id("d5c9def5-61f0-49ce-a860-d688edf28f6e")
server.datasources.populate_connections(ds)
ds 
>>> <tableauserverclient.models.datasource_item.DatasourceItem object at 0x000001D587581BB0>
path = server.datasources.download(ds.id)
>>>tableauserverclient.server.endpoint.exceptions.ServerResponseError:
>>>   404004: Resource Not Found
>>>            Datasource "d5c9def5-61f0-49ce-a860-d688edf28f6e" could not be found

Also, if I retrieve all datasources from the server it's not there

temp_list = [ds for ds in TSC.Pager(server.datasources.get) if ds.id == "d5c9def5-61f0-49ce-a860-d688edf28f6e"]:
temp_list
>>> []

DaniilBalabanov33N avatar Jan 28 '21 10:01 DaniilBalabanov33N

I am facing the same issue. Has there been any solution to this? Thanks

m4n1-code avatar Apr 14 '21 03:04 m4n1-code

Facing the same issue:

  • Datasource exists
  • Permissions are set correctly (for example ExtractXml=Allow)
  • Still getting error 404004 "Data source not found"

Any updates on this? Thanks

henrihapponen avatar Jun 16 '22 16:06 henrihapponen

I think this question is asking about embedded data sources. These are published as part of the workbook, and cannot be downloaded separately - you have to download the workbook as a complete twbx file.

jacalata avatar Feb 14 '23 21:02 jacalata

Hi @jacalata , Can you please check this again. Since as per the Tableau REST API documentation for Download Data Source, this method should download the datasource in .tdsx format and not twbx file.

Tableau REST API URL - https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref.htm#download_data_source

tdsx zip file contains the datasource extract which contains all the data extracted from backend database for that specific workbook.

Also the tableauserverclient method below is the python wrapper for the above API and its documentation also state the same.

tableauserverclient URL - https://tableau.github.io/server-client-python/docs/api-ref#datasourcesdownload

Downloads the specified data source in .tdsx or .hyper format..

but it is not working as per the REST API specification.

SathyanarayanaGowda avatar Feb 08 '24 17:02 SathyanarayanaGowda