Open alexepperly opened 1 year ago
It's not you - that relationship is very strange and the ids do not represent the same thing. There are some (ugly) workarounds described in this open issue: https://github.com/tableau/server-client-python/issues/825
It's not you - that relationship is very strange and the ids do not represent the same thing. There are some (ugly) workarounds described in this open issue: #825
Thanks for the update. Working on getting access to the Metadata API.
Having said that are there any plans to rectify this in future releases of TSC?
Yes , observed the same . As the datasource ids are different for the datasource attached to a workbook and the same datasource when lookup by NAME and not id.For example Say DS1(which has 2 database connections in it) is connected to a Workbook W . Now , when we populate connections for W we see DS1(with a different datasource id - d1 and connection id - c1). Now when we lookup DS1 by NAME all_datasource_items, pagination_item = server.datasources.get() datasource_id=[ds.id for ds in all_datasource_items if ds.name == Tableau_datasource_name ]
we see that DS1 has different datasourceid and also 2 database connections within DS1 have connection ids ( c2 and c3) ) which is different from c1 . So in short , reference a datasource by its name and not datasourceid as the id is different
Describe the bug
After populating workbook connections, the
datasource_id
s inworkbooks.connections.datasource_id
don't appear to match with any of theid
s from thedatasources.id
fields in our instance of Tableau Server.It's totally possible I am being a dunce somehow or that there is some "duh" solution to this, but I can't find it. A few of us at work have tried to figure this out, but we think there might be something buggy going on.
Versions
To Reproduce
After running these two functions (inside a class, hence all the
self
s):Results
...Then we take the
datasources.id
from our most used datasource on our server instance (whose id I got directly in the XML with Postman, but also shows up querying it various ways through TSC). However, the following query yields nothing, zilch, nada:To be sure, we have looked for tons and tons of
datasources.id
's (in many different ways), and NONE of them are showing up in the list ofworkbooks.connections.datasource_id
's that we have.In fact, we created a dataframe of datasources similar to how we created the
workbook_connections_df
above, to wit:...and none of the thousands of
id
's generated above are present when compared to thedatasource_id
values fromworkbook.connections
.We have tried doing this a ton of different ways, editing our classes, scripts, putting the values into SQL and querying/joining tables that way, and nothing seems to work.
Final TL;DR Version
The
workbooks.connections.datasource_id
property doesn't seem to matchdatasources.id
.(Or I'm doing something wrong.)
Thanks in advance for all your help!