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

Đang mở
#1,627 5 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
66/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
api

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.
Ngôn ngữ chính
Python
Star
716
Fork
446
Merge trung bình
8 ngày 8 giờ
Pull request đã merge (30 ngày)
2

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của tableau/server-client-python

Tất cả issue của tableau/server-client-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.