Repository navigation
Conversation
Wraps GET /customviews/{id}/default/users (API 3.21+, administrators only),
which lists the users who have a custom view set as their default.
Written with Claude Code
Wraps POST /customviews/{id}/default/users (API 3.21+, administrators only),
which makes one custom view the default for up to 100 users. Returns the
outcome for each user. strict=True raises DefaultViewAssignmentError if any
user failed; users that succeeded are still updated.
Accept any 2xx status, since this call returns 207 Multi-Status.
Written with Claude Code
- Reject a bare string for `users` with TypeError; list() would split it into one-character user IDs. - Warn when the server reports a different number of results than users requested. - DefaultViewAssignmentError no longer prints "None" for results that lack a user ID or error details. - Add tests for results without a user or error, a missing success attribute, an empty result list, and the Success_codes boundaries. Written with Claude Code
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #702
A custom view can be saved as the default view for individual users. TSC has no way to list those users or to set them. This adds both.
New methods
server.custom_views.get_users_with_default(view, req_options=None)returns(list[UserItem], PaginationItem): the users who have this custom view as their default. Paginated.server.custom_views.set_as_default_for_users(view, users, strict=False)sets the custom view as the default for up to 100 users and returns alist[UserDefaultViewAssignment]withuser_id,success,error_codeandsummaryfor each user.Both are API 3.21+ and administrator-only. Both accept a
CustomViewItemor an ID;usersacceptsUserItems or IDs.This is separate from
WorkbookItem.default_view_id, which is one value per workbook shared by every user.Behavior to review
strict=True,DefaultViewAssignmentErroris raised after the request when any user failed;.failuresholds those results. Users that succeeded are still updated, so strict mode is not all-or-nothing.MissingRequiredFieldErrorfor a missing view ID,TypeErrorifusersis a single string,ValueErrorfor no users, more than 100, or a user without an ID.Success_codesis now any 2xx (range(200, 300)). The REST docs list 200 for the set call, but Tableau Server's implementation responds 207 Multi-Status, which TSC rejected. This is global: 207 is not used by any other endpoint, and no in-repo code or test relies on a 2xx being treated as an error. The one behavior change is that a 205 or 206 response carrying an error body would now parse as success; no endpoint TSC calls returns those.Written with Claude Code