8000 Some revision properties not populating · Issue #1175 · tableau/server-client-python · GitHub
[go: up one dir, main page]

Skip to content

Some revision properties not populating #1175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jharris126 opened this issue Jan 13, 2023 · 7 comments
Closed

Some revision properties not populating #1175

jharris126 opened this issue Jan 13, 2023 · 7 comments

Comments

@jharris126
Copy link
Contributor
jharris126 commented Jan 13, 2023

Describe the bug
Key revision properties (current and created_at) of the RevisionItem are not populating or populating with default values.

Versions
Details of your environment, including:

  • Tableau Server version (or note if using Tableau Online): Tableau Server 2022.3
  • Python version: 3.9
  • TSC library version: 0.23.4

To Reproduce

wb = server.workbooks.get_by_id('90c3056a-eee6-4120-b1cd-194d8ba7dcb2')

server.workbooks.populate_revisions(wb)
wb_last_revision_tsc = wb.revisions[0]
print(
    wb_last_revision_tsc.revision_number,
    wb_last_revision_tsc.current,
    wb_last_revision_tsc.created_at
)

url = f'{server.baseurl}/sites/{server.site_id}/workbooks/{wb.id}/revisions'
revisions = requests.get(url, headers=request_headers).json()['revisions']

wb_last_revision = [rev for rev in revisions['revision'] if rev['current']][0]
print(
    wb_last_revision['revisionNumber'],
    wb_last_revision['current'],
    wb_last_revision['publishedAt']
)

Results

44 False None
44 True 2021-10-28T16:11:34Z

revision_number and current properties of the RevisionItem object are populating with default values instead of correct values.

@jharris126
Copy link
Contributor Author
jharris126 commented Jan 13, 2023

https://github.com/tableau/server-client-python/blob/master/tableauserverclient/models/revision_item.py#L70-L72
It looks like the issue is the XML response using different item names than TSC is expecting.

Actual xml response for my real revision example above:

<?xml version=\'1.0\' encoding=\'utf8\'?>\n<ns0:revision xmlns:ns0="http://tableau.com/api" revisionNumber="44" publishedAt="2021-10-28T16:11:34Z" deleted="false" current="true" sizeInBytes="128582">

isCurrent = current
isDeleted = deleted
createdAt = publishedAt

Not sure if this should be fixed in TSC or in the Tableau REST API itself because the expected values appear to match the Tableau REST API naming conventions more closely.

CC @jorwoods since we are chatting about this is Slack right now

@jorwoods
Copy link
Contributor

Thanks @jharris126! The official documentation does not match what is actually returned by the server endpoint. https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_revisions.htm#get_workbook_revisions

@jharris126
Copy link
Contributor Author

@alexepperly
Copy link

I'm having this same issue. Got a ton of "Nones" when trying to populate the same fields you're talking about.

@FritzJay
Copy link
FritzJay commented Feb 2, 2023

When can we expect the fix for this to be published? I'm running into the same issue.

@jacalata
Copy link
Contributor

fix is merged - should be published this week.

@alexepperly
Copy link

fix is merged - should be published this week.

Thank you! Looking forward to it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants
0