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

未关闭
#1,627 5 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
66/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
api

调研方向

Start at the subscription retrieval and update entry points used by server.subscriptions.get() and server.subscriptions.update(subscription), focusing on how SubscriptionItem.schedule_id is populated for Tableau Cloud. Reproduce the reported case with an active subscription and verify that schedule_id is returned and the update no longer fails with the null-schedule error.

由索引模型根据 Issue 内容生成。

描述

cloud gap in-progress Server-Side Enhancement

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.
主要语言
Python
星标
716
派生
446
平均合并
8 天 8 小时
30 天内合并 PR
2

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

tableau/server-client-python 的其他 Issue

查看 tableau/server-client-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。