Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ target-version = ['py39', 'py310', 'py311', 'py312', 'py313']
check_untyped_defs = false
disable_error_code = [
'misc',
# tableauserverclient\server\endpoint\datasources_endpoint.py:48: error: Cannot assign multiple types to name "FilePath" without an explicit "Type[...]" annotation [misc]
'annotation-unchecked' # can be removed when check_untyped_defs = true
]
files = ["tableauserverclient", "test", "samples"]
show_error_codes = true
ignore_missing_imports = true # defusedxml library has no types
no_implicit_reexport = true
implicit_optional = true

[tool.pytest.ini_options]
testpaths = ["test"]
Expand Down
12 changes: 7 additions & 5 deletions samples/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def main():
"--csv", dest="type", action="store_const", const=("populate_csv", "CSVRequestOptions", "csv", "csv")
)
# other options shown in explore_workbooks: workbook.download, workbook.preview_image

parser.add_argument("--language")
parser.add_argument("--workbook", action="store_true")

parser.add_argument("--file", "-f", help="filename to store the exported data")
Expand Down Expand Up @@ -74,16 +74,18 @@ def main():
populate = getattr(server.workbooks, populate_func_name)

option_factory = getattr(TSC, option_factory_name)
options: TSC.PDFRequestOptions = option_factory()

if args.filter:
options = option_factory().vf(*args.filter.split(":"))
else:
options = None
options = options.vf(*args.filter.split(":"))

if not options.language:
options.language = "de"
Comment thread
anyoung-tableau marked this conversation as resolved.
Outdated

if args.file:
filename = args.file
else:
filename = f"out.{extension}"
filename = f"out-{options.language}.{extension}"

populate(item, options)
with open(filename, "wb") as f:
Expand Down
48 changes: 26 additions & 22 deletions tableauserverclient/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@
PermissionsRule,
PersonalAccessTokenAuth,
ProjectItem,
Resource,
RevisionItem,
ScheduleItem,
SiteItem,
ServerInfoItem,
SubscriptionItem,
TableauItem,
TableItem,
TableauAuth,
Target,
Expand Down Expand Up @@ -65,65 +67,67 @@
)

__all__ = [
"get_versions",
"DEFAULT_NAMESPACE",
"BackgroundJobItem",
"BackgroundJobItem",
"ColumnItem",
"ConnectionCredentials",
"ConnectionItem",
"CSVRequestOptions",
"CustomViewItem",
"DQWItem",
"DailyInterval",
"DataAlertItem",
"DatabaseItem",
"DataFreshnessPolicyItem",
"DatasourceItem",
"DEFAULT_NAMESPACE",
"DQWItem",
"ExcelRequestOptions",
"FavoriteItem",
"FileuploadItem",
"Filter",
"FlowItem",
"FlowRunItem",
"FileuploadItem",
"get_versions",
"GroupItem",
"GroupSetItem",
"HourlyInterval",
"ImageRequestOptions",
"IntervalItem",
"JobItem",
"JWTAuth",
"LinkedTaskFlowRunItem",
"LinkedTaskItem",
"LinkedTaskStepItem",
"MetricItem",
"MissingRequiredFieldError",
"MonthlyInterval",
"NotSignedInError",
"Pager",
"PaginationItem",
"PDFRequestOptions",
"Permission",
"PermissionsRule",
"PersonalAccessTokenAuth",
"ProjectItem",
"RequestOptions",
"Resource",
"RevisionItem",
"ScheduleItem",
"SiteItem",
"Server",
"ServerInfoItem",
"ServerResponseError",
"SiteItem",
"Sort",
"SubscriptionItem",
"TableItem",
"TableauAuth",
"TableauItem",
"TableItem",
"Target",
"TaskItem",
"UserItem",
"ViewItem",
"VirtualConnectionItem",
"WebhookItem",
"WeeklyInterval",
"WorkbookItem",
"CSVRequestOptions",
"ExcelRequestOptions",
"ImageRequestOptions",
"PDFRequestOptions",
"RequestOptions",
"MissingRequiredFieldError",
"NotSignedInError",
"ServerResponseError",
"Filter",
"Pager",
"Server",
"Sort",
"LinkedTaskItem",
"LinkedTaskStepItem",
"LinkedTaskFlowRunItem",
"VirtualConnectionItem",
]
Loading