-
Notifications
You must be signed in to change notification settings - Fork 446
release v0.39 #1737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jacalata
wants to merge
106
commits into
master
Choose a base branch
from
development
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
release v0.39 #1737
Changes from all commits
Commits
Show all changes
106 commits
Select commit
Hold shift + click to select a range
8abda4b
Fix typo in update_datasource_data.py
vitorhonna 19cfec7
Merge branch 'tableau:master' into patch-2
vitorhonna 5eca29c
Merge branch 'master' into patch-2
vitorhonna 946d208
Merge pull request #1608 from vitorhonna/patch-2
jacalata 4147c73
fix: repr for auth objects
jorwoods 5e49f38
Merge pull request #1618 from jorwoods/jorwoods/pat_repr
jacalata 88985fe
Updated TSC with new API's
vchavatapalli 746b345
chore: refactor XML payload into RequestFactory
jorwoods 75f5f4c
style: black samples
jorwoods 8ee48d1
Merge pull request #1 from jorwoods/jorwoods/conns_req_fact
vchavatapalli 1fb57d5
Updated token name, value
vchavatapalli 9c2bec3
Clean up
vchavatapalli a40d774
Added response parsing
vchavatapalli b407590
Fixed issues
vchavatapalli d8922ed
New APIs: Update multiple connections in a single workbook/datasource…
vchavatapalli dc92d17
Minor fixes to request payloads
vchavatapalli 1add816
merge with dev branch
vchavatapalli a75bb40
Added assertions for test cases
vchavatapalli 9a1c675
style fix
vchavatapalli b90473d
Fixed the login method
vchavatapalli 0f62138
Merge pull request #1640 from vchavatapalli/minor-fixes-on-update-con…
jacalata 755ddec
feat: enable toggling attribute capture for a site (#1619)
jorwoods bca08ba
fix: put special fields first (#1622)
jorwoods 61062dc
feat: support OIDC endpoints (#1630)
jorwoods e51369c
feat: SiteAuthConfiguration str and repr (#1641)
jorwoods a7af8b7
fix: virtual connections username (#1628)
jorwoods 9b84601
fix: add contentType to tags batch actions (#1643)
jorwoods d065506
fix: add missing closing tags (#1644)
jorwoods e8aed24
ci: run tests against python 3.14 (#1660)
jorwoods a196281
chore: pytestify test_datasource_model (#1656)
jorwoods 915f1af
chore: convert workbook tests to pytest (#1645)
jorwoods 59eaebb
chore: convert test_auth to pytest (#1646)
jorwoods 575a1ae
chore: make datasource typing more specific (#1649)
jorwoods 7bd23f4
chore: embrace pytest in test_datasource (#1648)
jorwoods c31784a
chore: pytestify test_connection_ (#1650)
jorwoods 4ef5b99
chore: pytestify test_custom_view (#1651)
jorwoods 3c6e6e9
chore: pytestify test_data_freshness_policy (#1653)
jorwoods 388d5eb
chore: pytestify test_data_acceleration_report (#1652)
jorwoods 4becca6
chore: pytestify test_dataalert (#1654)
jorwoods 81f80ca
chore: pytestify test_database (#1655)
jorwoods 022e6f1
feat: add WebAuthoringForFlows capability to Permission class (#1642)
valsarajnivea fd187ba
feat: support collections in favorites (#1647)
jorwoods cba111a
Add UAT (unified access token) support to JWT login (#1671)
BereketBirbo 857e1c8
fix: mypy issues (#1667)
jorwoods 49ff1ae
Update permissions_item.py --added ExtractRefresh attribute (#1617) (…
jorwoods 2cb03a8
feat: make refresh consistent between endpoints (#1665)
jorwoods 4417beb
chore: pytestify test_endpoint (#1673)
jorwoods e34cfe7
feat: make ResourceReference hashable (#1668)
jorwoods 7b9d73b
samples: metadata.paginated_query (#1663)
jorwoods e648cd4
sample: basic user creation (#1664)
jorwoods 0fe4e2a
Add standard Salesforce CODEOWNERS file (#1694)
bcantoni 0f706c6
fix: datasource owner/project missing parsing (#1700)
jorwoods e8890d6
fix: datasource description update and publish (#1682)
jorwoods 39fbcac
chore: pytestify favorites (#1674)
jorwoods 89bdc42
chore: pytestify filter (#1675)
jorwoods 9c4322e
chore: pytestify flows (#1676)
jorwoods d4de5bd
chore: pytestify flowruns (#1677)
jorwoods 82a5c50
chore: pytestify flowtask (#1678)
jorwoods 20d738b
chore: pytestify groups (#1679)
jorwoods 423a042
chore: pytestify models repr (#1684)
jorwoods 5e75a72
chore: pytestify group_sets (#1685)
jorwoods 97124be
chore: pytestify jobs (#1686)
jorwoods ef7b971
chore: pytestify linked_tasks (#1687)
jorwoods af27931
chore: pytestify metadata (#1688)
jorwoods 27dedc4
chore: pytestify pager (#1690)
jorwoods 455e208
chore: pytestify permission_rule (#1691)
jorwoods ea10537
chore: pytestify project (#1692)
jorwoods 2882019
chore: pytestify regressions (#1693)
jorwoods 0e652ed
chore: pytestify oidc (#1689)
jorwoods d61ff8f
fix: black ci errors (#1713)
jorwoods f3f1ddf
chore: pytestify users (#1717)
jorwoods 4f38f0a
chore: pytestify request_option (#1695)
jorwoods 07be840
chore: pytestify requests (#1696)
jorwoods bc9154b
chore: pytestify schedule (#1697)
jorwoods 661b53d
chore: pytestify server info (#1698)
jorwoods 4daa34e
chore: pytestify views (#1707)
jorwoods e2f02bc
chore: pytestify task (#1706)
jorwoods bb127e8
chore: pytestify auth model (#1705)
jorwoods ade2ca0
chore: pytestify table (#1703)
jorwoods fcc8c8e
chore: pytestify subscriptions (#1702)
jorwoods 29bf79a
chore: pytestify sort (#1701)
jorwoods 54c48b0
chore: pytestify wb_model (#1710)
jorwoods 1021903
chore: pytestify webhooks (#1709)
jorwoods a4f0c8a
chore: pytestify virtual connections (#1708)
jorwoods 108b1bc
chore: pytestify ssl_config (#1722)
jorwoods bc11d2e
chore: pytestify filesys helpers (#1721)
jorwoods 912b4f1
chore: pytestify metrics (#1720)
jorwoods eaa1602
chore: pytestify http_requests (#1719)
jorwoods e51f43c
chore: pytestify test_site (#1699)
jorwoods b4ef4a8
chore: pytestify file uploads (#1715)
jorwoods fbe5a95
Update urllib (FOSSA) and black (#1723)
jacalata ba43c97
feat: delete view (#1712)
jorwoods 1e116f3
feat: batch create schedule (#1714)
jorwoods fe97749
feat: users csv import (#1409)
jorwoods 4d67996
Add pytest-xdist plugin to speed up tests (#1681)
bcantoni 19aaa33
chore: pytestify sort (#1725)
jorwoods e6b0ba1
chore: pytestify task_request (#1726)
jorwoods bfc692c
chore: pytestify exponential_backoff (#1727)
jorwoods 2461518
chore: remove unused unittest imports (#1728)
jorwoods 5146c09
fix: add workbook and view setter for custom view (#1730)
jorwoods f66bd09
feat: support extensions api (#1672)
jorwoods 24cf1ad
Add support for receiving "Customized Monthly" schedule intervals (#1…
bcantoni 6f525ff
fix: handle parameters for view filters (#1633)
jorwoods d9f644d
Jac/release automation (#1613)
jacalata 12f50c4
implement #816: project.get_by_id (#1736)
jacalata 09809d0
Merge branch 'master' into development
jacalata File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| tableauserverclient/_version.py export-subst | ||
| tableauserverclient/bin/_version.py export-subst |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| #ECCN:Open Source | ||
| #GUSINFO:Open Source,Open Source Workflow |
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
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| [build-system] | ||
| requires = ["setuptools>=75.0", "versioneer[toml]==0.29", "wheel"] | ||
| requires = ["setuptools>=77.0", "versioneer[toml]==0.29", "wheel"] | ||
| build-backend = "setuptools.build_meta" | ||
|
|
||
| [project] | ||
|
|
@@ -8,14 +8,14 @@ name="tableauserverclient" | |
| dynamic = ["version"] | ||
| description='A Python module for working with the Tableau Server REST API.' | ||
| authors = [{name="Tableau", email="[email protected]"}] | ||
| license = {file = "LICENSE"} | ||
| license-files = ["LICENSE"] | ||
| readme = "README.md" | ||
|
|
||
| dependencies = [ | ||
| 'defusedxml>=0.7.1', # latest as at 7/31/23 | ||
| 'packaging>=23.1', # latest as at 7/31/23 | ||
| 'requests>=2.32', # latest as at 7/31/23 | ||
| 'urllib3>=2.2.2,<3', | ||
| 'urllib3>=2.6.0,<3', | ||
| 'typing_extensions>=4.0', | ||
| ] | ||
| requires-python = ">=3.9" | ||
|
|
@@ -32,8 +32,14 @@ classifiers = [ | |
| repository = "https://github.com/tableau/server-client-python" | ||
|
|
||
| [project.optional-dependencies] | ||
| test = ["black==24.8", "build", "mypy==1.4", "pytest>=7.0", "pytest-cov", "pytest-subtests", | ||
| "requests-mock>=1.0,<2.0"] | ||
| test = ["black==24.10", "build", "mypy==1.4", "pytest>=7.0", "pytest-cov", "pytest-subtests", | ||
| "pytest-xdist", "requests-mock>=1.0,<2.0", "types-requests>=2.32.4.20250913"] | ||
|
|
||
| [tool.setuptools.packages.find] | ||
| where = ["tableauserverclient", "tableauserverclient.helpers", "tableauserverclient.models", "tableauserverclient.server", "tableauserverclient.server.endpoint"] | ||
|
|
||
| [tool.setuptools.dynamic] | ||
| version = {attr = "versioneer.get_version"} | ||
|
|
||
| [tool.black] | ||
| line-length = 120 | ||
|
|
@@ -61,5 +67,5 @@ addopts = "--junitxml=./test.junit.xml" | |
| VCS = "git" | ||
| style = "pep440-pre" | ||
| versionfile_source = "tableauserverclient/bin/_version.py" | ||
| versionfile_build = "tableauserverclient/bin/_version.py" | ||
| versionfile_build = "_version.py" | ||
| tag_prefix = "v" | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| #### | ||
| # This script demonstrates how to create a user using the Tableau | ||
| # Server Client. | ||
| # | ||
| # To run the script, you must have installed Python 3.7 or later. | ||
| #### | ||
|
|
||
|
|
||
| import argparse | ||
| import logging | ||
| import os | ||
| import sys | ||
| from typing import Sequence | ||
|
|
||
| import tableauserverclient as TSC | ||
|
|
||
|
|
||
| def parse_args(args: Sequence[str] | None) -> argparse.Namespace: | ||
| """ | ||
| Parse command line parameters | ||
| """ | ||
| if args is None: | ||
| args = sys.argv[1:] | ||
| parser = argparse.ArgumentParser(description="Creates a sample user group.") | ||
| # Common options; please keep those in sync across all samples | ||
| parser.add_argument("--server", "-s", help="server address") | ||
| parser.add_argument("--site", "-S", help="site name") | ||
| parser.add_argument("--token-name", "-p", help="name of the personal access token used to sign into the server") | ||
| parser.add_argument("--token-value", "-v", help="value of the personal access token used to sign into the server") | ||
| parser.add_argument( | ||
| "--logging-level", | ||
| "-l", | ||
| choices=["debug", "info", "error"], | ||
| default="error", | ||
| help="desired logging level (set to error by default)", | ||
| ) | ||
| # Options specific to this sample | ||
| # This sample has no additional options, yet. If you add some, please add them here | ||
| parser.add_argument("--role", "-r", help="Site Role for the new user", default="Unlicensed") | ||
| parser.add_argument( | ||
| "--user", | ||
| "-u", | ||
| help="Username for the new user. If using active directory, it should be in the format of SAMAccountName@FullyQualifiedDomainName", | ||
| ) | ||
| parser.add_argument( | ||
| "--email", "-e", help="Email address of the new user. If using active directory, this field is optional." | ||
| ) | ||
|
|
||
| return parser.parse_args(args) | ||
|
|
||
|
|
||
| def main(): | ||
| args = parse_args(None) | ||
|
|
||
| # Set logging level based on user input, or error by default | ||
| logging_level = getattr(logging, args.logging_level.upper()) | ||
| logging.basicConfig(level=logging_level) | ||
|
|
||
| tableau_auth = TSC.PersonalAccessTokenAuth(args.token_name, args.token_value, site_id=args.site) | ||
| server = TSC.Server(args.server, use_server_version=True, http_options={"verify": False}) | ||
| with server.auth.sign_in(tableau_auth): | ||
| # this code shows 2 different error codes for common mistakes | ||
| # 400013: Invalid site role | ||
| # 409000: user already exists on site | ||
|
|
||
| user = TSC.UserItem(args.user, args.role) | ||
| if args.email: | ||
| user.email = args.email | ||
| user = server.users.add(user) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| #### | ||
| # This script demonstrates how to use the metadata API to query information on a published data source | ||
| # | ||
| # To run the script, you must have installed Python 3.7 or later. | ||
| #### | ||
|
|
||
| import argparse | ||
| import logging | ||
| from pprint import pprint | ||
|
|
||
| import tableauserverclient as TSC | ||
|
|
||
|
|
||
| def main(): | ||
| parser = argparse.ArgumentParser(description="Use the metadata API to get information on a published data source.") | ||
| # Common options; please keep those in sync across all samples | ||
| parser.add_argument("--server", "-s", help="server address") | ||
| parser.add_argument("--site", "-S", help="site name") | ||
| parser.add_argument("--token-name", "-n", help="name of the personal access token used to sign into the server") | ||
| parser.add_argument("--token-value", "-v", help="value of the personal access token used to sign into the server") | ||
| parser.add_argument( | ||
| "--logging-level", | ||
| "-l", | ||
| choices=["debug", "info", "error"], | ||
| default="error", | ||
| help="desired logging level (set to error by default)", | ||
| ) | ||
| # Options specific to this sample | ||
| parser.add_argument( | ||
| "datasource_name", | ||
| nargs="?", | ||
| help="The name of the published datasource. If not present, we query all data sources.", | ||
| ) | ||
|
|
||
| args = parser.parse_args() | ||
|
|
||
| # Set logging level based on user input, or error by default | ||
| logging_level = getattr(logging, args.logging_level.upper()) | ||
| logging.basicConfig(level=logging_level) | ||
|
|
||
| # Sign in to server | ||
| tableau_auth = TSC.PersonalAccessTokenAuth(args.token_name, args.token_value, site_id=args.site) | ||
| server = TSC.Server(args.server, use_server_version=True) | ||
| with server.auth.sign_in(tableau_auth): | ||
| # Execute the query | ||
| result = server.metadata.query( | ||
| """ | ||
| # Query must declare that it accepts first and afterToken variables | ||
| query paged($first:Int, $afterToken:String) { | ||
| workbooksConnection(first: $first, after:$afterToken) { | ||
| nodes { | ||
| luid | ||
| name | ||
| projectName | ||
| description | ||
| } | ||
| totalCount | ||
| pageInfo { | ||
| endCursor | ||
| hasNextPage | ||
| } | ||
| } | ||
| } | ||
| """, | ||
| # "first" adjusts the page size. Here we set it to 5 to demonstrate pagination. | ||
| # Set it to a higher number to reduce the number of pages. Including | ||
| # first and afterToken is optional, and if not included, TSC will | ||
| # use its default page size of 100. | ||
| variables={"first": 5, "afterToken": None}, | ||
| ) | ||
|
|
||
| # Multiple pages are captured in result["pages"]. Each page contains | ||
| # the result of one execution of the query above. | ||
| for page in result["pages"]: | ||
| # Display warnings/errors (if any) | ||
| if page.get("errors"): | ||
| print("### Errors/Warnings:") | ||
| pprint(result["errors"]) | ||
|
|
||
| # Print the results | ||
| if result.get("data"): | ||
| print("### Results:") | ||
| pprint(result["data"]["workbooksConnection"]["nodes"]) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| import argparse | ||
| import logging | ||
| import tableauserverclient as TSC | ||
|
|
||
|
|
||
| def main(): | ||
| parser = argparse.ArgumentParser( | ||
| description="Update a single connection on a datasource or workbook to embed credentials" | ||
| ) | ||
|
|
||
| # Common options | ||
| parser.add_argument("--server", "-s", help="Server address", required=True) | ||
| parser.add_argument("--site", "-S", help="Site name", required=True) | ||
| parser.add_argument("--token-name", "-p", help="Personal access token name", required=True) | ||
| parser.add_argument("--token-value", "-v", help="Personal access token value", required=True) | ||
| parser.add_argument( | ||
| "--logging-level", | ||
| "-l", | ||
| choices=["debug", "info", "error"], | ||
| default="error", | ||
| help="Logging level (default: error)", | ||
| ) | ||
|
|
||
| # Resource and connection details | ||
| parser.add_argument("resource_type", choices=["workbook", "datasource"]) | ||
| parser.add_argument("resource_id", help="Workbook or datasource ID") | ||
| parser.add_argument("connection_id", help="Connection ID to update") | ||
| parser.add_argument("datasource_username", help="Username to set for the connection") | ||
| parser.add_argument("datasource_password", help="Password to set for the connection") | ||
| parser.add_argument("authentication_type", help="Authentication type") | ||
|
|
||
| args = parser.parse_args() | ||
|
|
||
| # Logging setup | ||
| logging_level = getattr(logging, args.logging_level.upper()) | ||
| logging.basicConfig(level=logging_level) | ||
|
|
||
| tableau_auth = TSC.PersonalAccessTokenAuth(args.token_name, args.token_value, site_id=args.site) | ||
| server = TSC.Server(args.server, use_server_version=True) | ||
|
|
||
| with server.auth.sign_in(tableau_auth): | ||
| endpoint = {"workbook": server.workbooks, "datasource": server.datasources}.get(args.resource_type) | ||
|
|
||
| update_function = endpoint.update_connection | ||
| resource = endpoint.get_by_id(args.resource_id) | ||
| endpoint.populate_connections(resource) | ||
|
|
||
| connections = [conn for conn in resource.connections if conn.id == args.connection_id] | ||
| assert len(connections) == 1, f"Connection ID '{args.connection_id}' not found." | ||
|
|
||
| connection = connections[0] | ||
| connection.username = args.datasource_username | ||
| connection.password = args.datasource_password | ||
| connection.auth_type = args.authentication_type | ||
| connection.embed_password = True | ||
|
|
||
| updated_connection = update_function(resource, connection) | ||
| print(f"Updated connection: {updated_connection.__dict__}") | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
whereparameter in[tool.setuptools.packages.find]should typically be set to the root directory (e.g.,[\".\"]), not individual package paths. The current configuration may not correctly discover packages. Consider usingwhere = [\".\"]withincludeto specify packages, or rely on automatic discovery.