docs: clarify username formats, ProjectLeader-as-group, and filter special-char behavior - #1854
Open
jacalata wants to merge 3 commits into
Open
docs: clarify username formats, ProjectLeader-as-group, and filter special-char behavior#1854jacalata wants to merge 3 commits into
jacalata wants to merge 3 commits into
Conversation
…ecial-char behavior Bundles three long-standing docs gaps flagged in stale issues: #993 - users.add example used a fake short username with no explanation that `name` is the server auth identifier (email on Cloud, SAM@Domain on AD-backed Server), not the person's display name. Rewrote the users.add docstring intro to describe the required formats per auth scheme, split the example into a Cloud invocation and an AD invocation, and added matching guidance to UserItem.name. #1067 - projects.update_permissions had no examples, so callers had no guide for the common "assign group as Project Leader" case. Added an example that shows constructing a PermissionsRule with grantee=<group> and capability=ProjectLeader, plus a note that update_permissions is a full replacement (call populate_permissions first if preserving existing rules). #1200 - the REST filter grammar treats ',', '&', ':', '[' and ']' as delimiters and the server does not support escaping, so `filter(name="T(L-F,SZ&V-MY)")` fails with 400065 for any name containing those characters. Documented the constraint on the Filter class docstring and on QuerySet.filter, along with the working wildcard workaround (Equals with '*' substituted). No behavior change. Docs only. Closes #993, #1067, #1200.
The Equals-operator wildcard workaround for special characters requires Tableau Cloud May 2023 or Tableau Server 2022.1.14 (per the REST API "Filtering and Sorting" docs). Older servers reject `*` as a literal, so readers on those need to know before copying the example. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR updates in-code documentation (docstrings) to clarify several commonly-misunderstood behaviors in the Tableau Server Client (TSC) Python library—specifically around user creation identifiers, project permission rules for Project Leaders, and REST filter limitations with reserved delimiter characters.
Changes:
- Clarifies
UserItem.name/users.adddocumentation to distinguish authentication username vs display name, with auth-scheme-specific examples. - Adds a concrete
projects.update_permissionsexample for assigning a group asProjectLeader, plus a warning that the call replaces the full permissions list. - Documents REST filter reserved delimiter characters and the
*wildcard workaround inFilterandQuerySet.filterdocstrings.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tableauserverclient/server/query.py | Adds QuerySet.filter docstring explaining shorthand operators and special-character caveat. |
| tableauserverclient/server/filter.py | Adds detailed Filter docstring documenting delimiter characters and wildcard workaround/version constraints. |
| tableauserverclient/server/endpoint/users_endpoint.py | Clarifies users.add docstring about required username formats and adds clearer examples. |
| tableauserverclient/server/endpoint/projects_endpoint.py | Adds an example for assigning a group as Project Leader and notes replacement semantics. |
| tableauserverclient/models/user_item.py | Clarifies UserItem.name parameter semantics and required formats per auth scheme. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+191
to
+194
| Each keyword argument becomes one filter. Shorthand suffixes select | ||
| the operator (e.g. ``name__gt="A"`` -> operator ``GreaterThan``); a | ||
| bare keyword uses ``Equals``. See ``docs/filter-sort.md`` for the | ||
| supported suffixes. |
jacalata
added a commit
that referenced
this pull request
Aug 17, 2026
Previous wording said wildcards, ranges, and operators are "NOT supported" -- but I don't have live verification that `*` or `%` are inert in a vf_ value. The public filtering docs describe only exact match and OR-lists; behavior of other characters is undocumented, not verifiably absent. Rephrase to say what we know (docs don't cover it, TSC doesn't emit operator prefixes) and tell callers to verify against their target server before relying on the outcome. This is intentionally less prescriptive than the previous version. The related open PR #1854 was flagged by the same fresh-eyes pass for making an unverified `*`-as-wildcard claim in the opposite direction -- both PRs should stay in "docs describe X; other behaviors are untested" territory until we run the experiments. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Three fresh-eyes findings: - Replace Unicode em dashes (U+2014) in filter.py and users_endpoint.py docstrings with ASCII `--` or `;`, matching the repo's ASCII-only convention that other docstrings follow. - query.py referenced docs/filter-sort.md, which lives on the gh-pages branch and does not exist in an installed package. Swap for the published URL so a `help()` reader can actually reach the doc. - Soften the AD username claim in users_endpoint.py: a bare SAMAccountName's resolution depends on the AD configuration, so "typically will not resolve" was stated more strongly than the surrounding server-behavior guidance warranted.
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 #993, #1067, #1200.
Motivation
Three long-standing stale issues, all traceable to gaps in the same doc
region:
users.adddocstring gave no hint thatnameis the server-sideauthentication identifier, not the person's display name. The primary
example
TSC.UserItem('new_user', ...)misleads readers into treating itas a display-name field.
projects.update_permissionshad no examples, so callers had noguide for the common "assign a group as Project Leader" case.
,,&,:,[,]asdelimiters and the server does not support escaping, but nothing in the
docstring warned about this or documented the wildcard workaround.
Behavior change
Docs only. No API change.
UserItem.name+users.adddocstrings describe the required format perauth scheme: Cloud = email, local Server = username, AD-backed =
SAMAccountName@FullyQualifiedDomainor UPN. Example split into Cloud +AD invocations.
projects.update_permissionsexample constructs aPermissionsRulewith
grantee=<group>andcapability=ProjectLeader, plus a note thatupdate_permissionsfully replaces existing rules (callpopulate_permissionsfirst if preserving).Filterclass +QuerySet.filterdocstrings document the reserveddelimiter characters and the
*-wildcard workaround under the Equalsoperator, citing the server version requirement (Tableau Cloud May 2023
or Tableau Server 2022.1.14) sourced from the public "Filtering and
Sorting" REST API docs.
Test plan
test/test_user.py,test_user_model.py,test_project.py,test_project_model.py,test_filter.py: 89 passed🤖 Generated with Claude Code