Skip to content

Some revision properties not populating #1175

Closed

Description

@jharris126

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.

Activity

  1. jharris126 commented on Jan 13, 2023

    @jharris126
    ContributorAuthor

    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

  2. jorwoods commented on Jan 13, 2023

    @jorwoods
    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

  3. jharris126 commented on Jan 13, 2023

    @jharris126
    ContributorAuthor
  4. alexepperly commented on Feb 2, 2023

    @alexepperly

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

  5. FritzJay commented on Feb 2, 2023

    @FritzJay

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

  6. jacalata commented on Feb 14, 2023

    @jacalata
    Contributor

    fix is merged - should be published this week.

  7. alexepperly commented on Feb 14, 2023

    @alexepperly

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions