Skip to content

SubscriptionItem is different for Tableau Cloud/on-prem: currently only works for Cloud #1627

@kareltv

Description

@kareltv

Describe the bug
When retrieving subscriptions using the TSC API on Tableau Online (Tableau Cloud), the SubscriptionItem.schedule_id field is always None, even for active subscriptions that were created with a valid schedule. This makes it impossible to update these subscriptions (e.g. suspend them), as the schedule ID is required for the update call.

Versions
Tableau: Tableau Online (Cloud)

Python: Python 3.11.10

TSC library: 0.38

To Reproduce

import tableauserverclient as TSC

tableau_auth = TSC.PersonalAccessTokenAuth(
    token_name=TOKEN_NAME,
    personal_access_token=TOKEN_SECRET,
    site_id=SITE_ID
)
server = TSC.Server(SERVER_URL, use_server_version=True)

with server.auth.sign_in(tableau_auth):
    all_subscriptions, pagination_item = server.subscriptions.get()
    for subscription in all_subscriptions:
        print(
            f"Subscription ID: {subscription.id}, "
            f"Name: {subscription.subject}, "
            f"Suspended: {subscription.suspended}, "
            f"Schedule ID: {subscription.schedule_id}, "  # Always None
            f"User ID: {subscription.user_id}"
        )

Outputs:

Subscription ID: abc, Name: test test, suspended: False, Schedule ID: None, user ID: abc

Results
Even though the subscription is active and was created using a valid schedule, the subscription.schedule_id is always None. This causes server.subscriptions.update(subscription) to fail with the following error:

404023: Resource Not Found
Schedule 'null' could not be found.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Server-Side EnhancementcloudFunctionality specific to Tableau CloudgapA gap in the library for existing server functionality

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions