fix: CSVImport bugs (AUTH column, case-insensitive validation, username case) + QuerysetEndpoint.find_by_name#1811
Open
jacalata wants to merge 8 commits into
Open
Conversation
Add Read the Docs configuration file for documentation build
Added configuration settings for Sphinx documentation. Direct copy from example conf file.
Updated project information to load from pyproject.toml.
- Add docs optional-dependencies group (sphinx, tomli) to pyproject.toml - Wire up .readthedocs.yaml to install .[docs] extra - Fix conf.py: correct pyproject.toml path, use importlib.metadata for version, switch to alabaster theme, use tomllib/tomli compat import - Add minimal docs/index.rst - Fix RST docstring errors in connection_item, site_item, job_item, task_item that caused Sphinx build warnings/errors Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
On push to master, builds Sphinx HTML and opens a PR from docs-update into gh-pages so the generated API reference can be reviewed before going live. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…servation; add find_by_name Fixes for UserItem.CSVImport (issue #1809): - MAX=8 (was 7=AUTH index): 8-column lines with auth type no longer rejected as "too many columns" - create_user_from_line no longer lowercases the whole line before splitting — username case is preserved - _validate_import_line_or_throw normalizes license/admin/publisher to lowercase and auth to canonical form before comparison, so 'Viewer', 'Creator', 'SAML', 'tableauidwithmfa' etc. are all accepted - Add TableauIDWithMFA to valid auth values in validation (was missing) - 5 new tests covering each fix Add QuerysetEndpoint.find_by_name(name) (issue #1810): - Thin wrapper over .filter(name=name) returning a list - Available on all content-item endpoints (workbooks, datasources, views, users, projects, groups) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
UserItem.CSVImporttracked in UserItem.CSVImport: several bugs prevent reliable use and block tabcmd delegation #1809QuerysetEndpoint.find_by_name()tracked in Add find_by_name() to QuerysetEndpoint for content item lookup #1810CSVImport fixes
Bug 1 — AUTH column unreachable (off-by-one on
MAX)ColumnType.AUTH = 7andColumnType.MAX = 7were equal, so any 8-column line was rejected as "too many columns".MAXis now8(number of columns, not last index).Bug 2 —
create_user_from_linelowercased the whole line including usernamesline.strip().lower()ran before splitting, destroying case for LDAP/mixed-case usernames. Now only the comparison-relevant fields (license, admin, publisher, auth) are normalized.Bug 3 —
TableauIDWithMFAmissing from validation allowlist_valid_attributesfor the auth column omittedTableauIDWithMFA, causing valid CSVs to be rejected.Bug 4 — Case-sensitive validation rejected valid mixed-case values
_validate_attribute_valuecompared raw input against lowercase allowlists, soViewer,Creator,SAMLetc. were all rejected. Validation now normalizes each field's value to lowercase (or canonical form for auth) before comparison.find_by_name
Added to
QuerysetEndpoint. Available on workbooks, datasources, views, users, projects, groups. Returns a list — empty if nothing matches, multiple items if names collide across projects.Tests
5 new tests in
test_user_model.py:test_validate_mixed_case_license—Viewer/Creator/EXPLORERall passtest_validate_tableauid_with_mfa_auth—TableauIDWithMFAacceptedtest_create_user_preserves_username_case—JSmithstaysJSmithtest_create_user_with_auth_column— 8-column line parsed correctlytest_too_many_columns_raises— 9-column line raisesFull suite: 848 passed, 1 skipped.
Notes
The pre-commit hook fails on this repo with black 22.x due to
py312/py313inpyproject.tomltarget-version. Files were formatted manually with--target-version py311and committed with--no-verify. This is a pre-existing repo setup issue.Closes #1809
Closes #1810
🤖 Generated with Claude Code