Skip to content

Commit 72eb3c8

Browse files
jacalataLGraberdependabot[bot]
authored
0.28 - JWT Auth (#1288)
* Code coverage and pretty printing (#1283) * implement str and repr for a bunch more classes * also: JWT, user-impersonation (cherry picked from commit 4887a62) * fix code coverage action * use reflection to find all models for comprehensive testing. --------- Co-authored-by: Lee Graber <[email protected]> * update publish action (#1286) * 0.27 (#1272) * Bump urllib3 from 2.0.4 to 2.0.6 (#1287) * Bump urllib3 from 2.0.4 to 2.0.6 Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.0.4 to 2.0.6. - [Release notes](https://github.com/urllib3/urllib3/releases) - [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst) - [Commits](urllib3/urllib3@2.0.4...2.0.6) --- updated-dependencies: - dependency-name: urllib3 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Lee Graber <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 7ed0a43 commit 72eb3c8

27 files changed

+207
-90
lines changed

.github/workflows/code-coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
3131
# https://github.com/marketplace/actions/pytest-coverage-comment
3232
- name: Generate coverage report
33-
run: pytest --junitxml=pytest.xml --cov=tableauserverclient tests/ | tee pytest-coverage.txt
33+
run: pytest --junitxml=pytest.xml --cov=tableauserverclient test/ | tee pytest-coverage.txt
3434

3535
- name: Comment on pull request with coverage
3636
uses: MishaKav/pytest-coverage-comment@main

.github/workflows/publish-pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
fetch-depth: 0
2020
- uses: actions/setup-python@v4
2121
with:
22-
python-version: 3.7
22+
python-version: 3.9
2323
- name: Build dist files
2424
run: |
2525
python -m pip install --upgrade pip

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ For more information on installing and using TSC, see the documentation:
1919

2020

2121
## License
22-
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Ftableau%2Fserver-client-python.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Ftableau%2Fserver-client-python?ref=badge_large)
22+
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Ftableau%2Fserver-client-python.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Ftableau%2Fserver-client-python?ref=badge_large)

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ dependencies = [
1515
'defusedxml>=0.7.1', # latest as at 7/31/23
1616
'packaging>=23.1', # latest as at 7/31/23
1717
'requests>=2.31', # latest as at 7/31/23
18-
'urllib3==2.0.4', # latest as at 7/31/23
18+
'urllib3==2.0.6', # latest as at 7/31/23
1919
]
2020
requires-python = ">=3.7"
2121
classifiers = [
@@ -31,7 +31,8 @@ classifiers = [
3131
repository = "https://github.com/tableau/server-client-python"
3232

3333
[project.optional-dependencies]
34-
test = ["argparse", "black==23.7", "mock", "mypy==1.4", "pytest>=7.0", "pytest-subtests", "requests-mock>=1.0,<2.0"]
34+
test = ["argparse", "black==23.7", "mock", "mypy==1.4", "pytest>=7.0", "pytest-cov", "pytest-subtests",
35+
"requests-mock>=1.0,<2.0"]
3536

3637
[tool.black]
3738
line-length = 120

tableauserverclient/__init__.py

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,47 @@
11
from ._version import get_versions
22
from .namespace import NEW_NAMESPACE as DEFAULT_NAMESPACE
3-
from .models import *
3+
from .models import (
4+
BackgroundJobItem,
5+
ColumnItem,
6+
ConnectionCredentials,
7+
ConnectionItem,
8+
CustomViewItem,
9+
DQWItem,
10+
DailyInterval,
11+
DataAlertItem,
12+
DatabaseItem,
13+
DatasourceItem,
14+
FavoriteItem,
15+
FlowItem,
16+
FlowRunItem,
17+
FileuploadItem,
18+
GroupItem,
19+
HourlyInterval,
20+
IntervalItem,
21+
JobItem,
22+
JWTAuth,
23+
MetricItem,
24+
MonthlyInterval,
25+
PaginationItem,
26+
Permission,
27+
PermissionsRule,
28+
PersonalAccessTokenAuth,
29+
ProjectItem,
30+
RevisionItem,
31+
ScheduleItem,
32+
SiteItem,
33+
ServerInfoItem,
34+
SubscriptionItem,
35+
TableItem,
36+
TableauAuth,
37+
Target,
38+
TaskItem,
39+
UserItem,
40+
ViewItem,
41+
WebhookItem,
42+
WeeklyInterval,
43+
WorkbookItem,
44+
)
445
from .server import (
546
CSVRequestOptions,
647
ExcelRequestOptions,

tableauserverclient/models/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
from .site_item import SiteItem
3232
from .subscription_item import SubscriptionItem
3333
from .table_item import TableItem
34-
from .tableau_auth import Credentials, TableauAuth, PersonalAccessTokenAuth
34+
from .tableau_auth import Credentials, TableauAuth, PersonalAccessTokenAuth, JWTAuth
3535
from .tableau_types import Resource, TableauItem, plural_type
3636
from .tag_item import TagItem
3737
from .target import Target

tableauserverclient/models/column_item.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ def __init__(self, name, description=None):
99
self.description = description
1010
self.name = name
1111

12+
def __repr__(self):
13+
return f"<{self.__class__.__name__} {self._id} {self.name} {self.description}>"
14+
1215
@property
1316
def id(self):
1417
return self._id

tableauserverclient/models/connection_credentials.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ def __init__(self, name, password, embed=True, oauth=False):
1515
self.embed = embed
1616
self.oauth = oauth
1717

18+
def __repr__(self):
19+
if self.password:
20+
print = "redacted"
21+
else:
22+
print = "None"
23+
return f"<{self.__class__.__name__} name={self.name} password={print} embed={self.embed} oauth={self.oauth} >"
24+
1825
@property
1926
def embed(self):
2027
return self._embed

tableauserverclient/models/data_acceleration_report_item.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ def avg_non_accelerated_plt(self):
4646
def __init__(self, comparison_records):
4747
self._comparison_records = comparison_records
4848

49+
def __repr__(self):
50+
return f"<(deprecated)DataAccelerationReportItem site={self.site} sheet={sheet_uri}>"
51+
4952
@property
5053
def comparison_records(self):
5154
return self._comparison_records

tableauserverclient/models/group_item.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,9 @@ def __init__(self, name=None, domain_name=None) -> None:
2626
self.name: Optional[str] = name
2727
self.domain_name: Optional[str] = domain_name
2828

29-
def __str__(self):
29+
def __repr__(self):
3030
return "{}({!r})".format(self.__class__.__name__, self.__dict__)
3131

32-
__repr__ = __str__
33-
3432
@property
3533
def domain_name(self) -> Optional[str]:
3634
return self._domain_name
@@ -48,7 +46,6 @@ def name(self) -> Optional[str]:
4846
return self._name
4947

5048
@name.setter
51-
@property_not_empty
5249
def name(self, value: str) -> None:
5350
self._name = value
5451

0 commit comments

Comments
 (0)