server-client-python icon indicating copy to clipboard operation
server-client-python copied to clipboard

Filtering Datasources using the "In" Operator

Open tuse0708 opened this issue 4 years ago • 3 comments

When attempting to filter using the "In" operator on datasources, I am able to filter a single source using "Equals" but if I switch to "In" and supply a list, I get "400065: Bad Request. The filter query is missing a value for key 'name'."

Versions

Tableau Server Version: 2019.4.2 (20194.20.0119.2058) 64-bit Linux Python 3.8.4 TSC library version - 0.15

To Reproduce

import tableauserverclient as TSC

username = ""
pw = ""
site = ""
tableau_auth = TSC.TableauAuth(username, pw, site)
server = TSC.Server('https://HOSTNAME/', use_server_version=True)
req_option = TSC.RequestOptions()

jobs_to_refresh = ['Example Job 1','Example Job 2']

with server.auth.sign_in(tableau_auth):
    req_option.filter.add(TSC.Filter(TSC.RequestOptions.Field.Name,
                                TSC.RequestOptions.Operator.In,
                                jobs_to_refresh))
    matching_datasources, pagination_item = server.datasources.get(req_options=req_option)
    print(matching_datasources[0].name, matching_datasources[0].id)

Results 400065: Bad Request. The filter query is missing a value for key 'name'.

tuse0708 avatar Mar 25 '21 15:03 tuse0708