Skip to content

Fix W-21968404: Make authentication_type optional in update_connections#1778

Open
vchavatapalli wants to merge 4 commits intotableau:developmentfrom
vchavatapalli:fix-update-connections-optional-auth
Open

Fix W-21968404: Make authentication_type optional in update_connections#1778
vchavatapalli wants to merge 4 commits intotableau:developmentfrom
vchavatapalli:fix-update-connections-optional-auth

Conversation

@vchavatapalli
Copy link
Copy Markdown
Contributor

Make the authentication_type parameter optional in update_connections
methods for both datasources and workbooks, allowing users to update
connection credentials without modifying the authentication type.

Problem

Users were confused by the update_connections method, attempting to use
it for general credential updates but encountering errors because
authentication_type was required. This forced them to specify an auth
type even when they only wanted to update usernames/passwords.

Solution

  • Made authentication_type parameter optional (default=None) in:

    • Datasources.update_connections()
    • Workbooks.update_connections()
    • DatasourceRequest.update_connections_req()
    • WorkbookRequest.update_connections_req()
  • Updated XML request generation to only include authenticationType
    attribute when explicitly provided

  • Enhanced docstrings to clarify that omitting authentication_type
    preserves the existing configuration

Changes

  • tableauserverclient/server/endpoint/datasources_endpoint.py
  • tableauserverclient/server/endpoint/workbooks_endpoint.py
  • tableauserverclient/server/request_factory.py
  • samples/update_connections_auth.py (made CLI args optional)
  • test/test_datasource.py (added test without auth_type)
  • test/test_workbook.py (added test without auth_type)
  • test/assets/*.xml (added test fixtures)

Benefits

✓ Backward compatible - existing code continues to work
✓ More flexible - update credentials independently of auth type
✓ Better UX - eliminates confusion about method purpose
✓ Safer - no risk of accidentally changing auth type

Testing

Added comprehensive tests for both datasources and workbooks that verify:

  • Connections can be updated without providing authentication_type
  • Existing authentication_type is preserved in response
  • All connection LUIDs are successfully updated

jacalata and others added 2 commits February 3, 2026 12:18
jorwoods/package install fix (jorwoods/package install fix tableau#1747)
Revert "refer to single package entrypoint (refer to single package entrypoint tableau#1739)"
This reverts commit 043efa1.
fix: make pyproject.toml more explicity in what is included
chore: remove commented out config
Co-authored-by: Jordan Woods 13803242+jorwoods@users.noreply.github.com
This change addresses a usability issue where users were confused by the
update_connections method name and were using it for general connection
updates without realizing it required an authentication_type parameter.

Changes:
- Made authentication_type parameter optional in both datasource and workbook
  update_connections methods
- Updated request_factory to only set authenticationType in XML when provided
- Enhanced docstrings to clarify that authentication_type is optional and
  existing auth types are preserved when not specified
- Updated sample script to demonstrate optional parameter usage
- Added comprehensive tests for both datasources and workbooks when
  authentication_type is not provided

Benefits:
- Backward compatible: existing code continues to work
- More flexible: users can now update credentials without changing auth type
- Clearer intent: function can be used for both auth type changes and
  general credential updates
- Better UX: eliminates confusion about the function's purpose

The function safely iterates through each connection LUID independently,
so there's no risk of cross-contamination when auth type is omitted.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@salesforce-cla
Copy link
Copy Markdown

salesforce-cla Bot commented May 5, 2026

Thanks for the contribution! Unfortunately we can't verify the commit author(s): Vineeth Sai Surya Chavatapalli <v***@s***.com>. One possible solution is to add that email to your GitHub account. Alternatively you can change your commits to another email and force push the change. After getting your commits associated with your GitHub account, refresh the status of this Pull Request.

…thon into fix-update-connections-optional-auth

# Conflicts:
#	samples/update_connection_auth.py
#	samples/update_connections_auth.py
#	tableauserverclient/server/endpoint/datasources_endpoint.py
#	tableauserverclient/server/endpoint/workbooks_endpoint.py
#	tableauserverclient/server/request_factory.py
#	test/test_datasource.py
#	test/test_workbook.py
@vchavatapalli vchavatapalli force-pushed the fix-update-connections-optional-auth branch from c30fa2b to 354dc94 Compare May 5, 2026 12:45
- Resolved remaining conflict markers in test_datasource.py and test_workbook.py
- Added missing imports for read_xml_assets and asset from _utils
- All black formatting checks now pass
- All mypy type checks now pass

These fixes ensure CI passes on macOS, Ubuntu, and Windows.
@vchavatapalli vchavatapalli force-pushed the fix-update-connections-optional-auth branch from ca52d17 to f0481fc Compare May 5, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants