Skip to content

Trouble filtering server.flows.get() #1588

@cpare

Description

@cpare

With my TSC API version set to match the server (3.19) I am unable to issue a filtered query for flows - is this a defect, or am I doing something wrong?

Code:

import tableauserverclient as TSC

siteName = 'myTableauSite'
serverUrl = 'https://localhost'
tokenName = 'TSC_TOKEN'
tokenSecret = ''
tagName = 'Test'

tableau_auth = TSC.PersonalAccessTokenAuth(tokenName, tokenSecret, siteName)
server = TSC.Server(serverUrl, use_server_version=True)
server.add_http_options({'verify': 'c:/temp/TSC.crt'})
print("Initial Rest API version:", server.version)

s_info = server.server_info.get()
print("\nServer info:")
print("\tProduct version: {0}".format(s_info.product_version))
print("\tREST API version: {0}".format(s_info.rest_api_version))
print("\tBuild number: {0}".format(s_info.build_number))

with server.auth.sign_in(tableau_auth):
server.version = s_info.rest_api_version
print("Current Rest API version:", server.version)
all_flow_items, pagination_item = server.flows.get()
print("There are {} flows on site:" .format(pagination_item.total_available))
print([[flow.id, flow.name] for flow in all_flow_items])

print('Find flows tagged with {tagName}')
req_option = TSC.RequestOptions()
req_option.filter.add(TSC.Filter(TSC.RequestOptions.Field.Tags,
TSC.RequestOptions.Operator.Equals,
tagName))
flow_items, pagination_item = server.flows.get(req_option)

Output

Initial Rest API version: 2.4

Server info:
Product version: 2023.1.16
REST API version: 3.19
Build number: 20231.24.0809.0841
Current Rest API version: 3.19
There are 1 flows on site:
[['00000000-0000-0000-0000-000000000000', 'Test Flow']]
Find flows tagged with {tagName}
400065: Bad Request
The filter query contains a key which is not recognized for this api version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions