我只想获取那些类型的datasources:提取,以及跳过Live数据源上的。我正在使用tableauserverclient python库。
我已经在网上找到了可以根据数据源名称进行筛选的代码,但是我希望根据数据源类型进行筛选。下面是数据源名称上的文件处理代码:
req_option = TSC.RequestOptions()
req_option.filter.add(TSC.Filter(TSC.RequestOptions.Field.Name,
TSC.RequestOptions.Operator.Equals,
'Superstore'))
datasources = server.datasources.get(req_option)发布于 2022-09-13 21:20:05
根据文档,无法对req_options中的源类型进行筛选。以下是您可以在req_options中筛选的项目:
For the above endpoints, you can filter or sort on the following fields:
CreatedAt
LastLogin
Name
OwnerName
SiteRole
Tags
UpdatedAt但是,在提取所有数据源之后,可以使用一个has_extracts属性。
试试下面的代码:
with server.auth.sign_in(tableau_auth):
# get all projects on site
all_project_items, pagination_item = server.datasources.get()
for x in all_project_items:
if x.has_extracts:
print(x.name, x.id, x.project_name, x.has_extracts)https://stackoverflow.com/questions/73703887
复制相似问题