tableau / server-client-python

A Python library for the Tableau Server REST API
https://tableau.github.io/server-client-python/
MIT License
648 stars 416 forks source link

TSC.RequestOptions.Field.ContentUrl no longer working with Tableau Server 2023.3.4 #1393

Open veruzi opened 1 month ago

veruzi commented 1 month ago

Describe the bug Have two Tableau Servers, one at version 2023.3.2 and one at version 2023.3.4. I was using "TSC.Filter(TSC.RequestOptions.Field.ContentUrl, TSC.RequestOptions.Operator.Equals, content_url)" to filter the workbooks by "content_url". That is working fine in 2023.3.2 but no longer working in 2023.3.4 (code and error below)

Versions Details of your environment, including:

To Reproduce Steps to reproduce the behavior. Please include a code snippet where possible.

import tableauserverclient as TSC

SERVER_URL = "https://my-server-at-2023.3.4.com"
USERNAME = "my_user"
PASSWORD = "my_password"
SITE = "my_site"

content_url = "myContentUrlName"

 # Initialize Tableau Server Client
tableau_auth = TSC.TableauAuth(USERNAME, PASSWORD, SITE)
#server = TSC.Server(SERVER_URL, use_server_version=True)
server = TSC.Server(SERVER_URL, use_server_version=True)
server.add_http_options({'verify': False})

req_options = TSC.RequestOptions()

req_options.filter.add(
    TSC.Filter(TSC.RequestOptions.Field.ContentUrl, TSC.RequestOptions.Operator.Equals, content_url)
)
with server.auth.sign_in(tableau_auth):
    # Get users with options
    workbooks, pagination_item = server.workbooks.get(req_options=req_options)

    if workbooks:
        # Return the first user found
        print(workbooks[0])
    else:
        print("No workbooks found")

Results

tableauserverclient.server.endpoint.exceptions.ServerResponseError:

        400065: Bad Request
                The filter query contains a key which is not recognized for this api version.

Same code above works great when pointing to the Tableau Server v2023.3.2.

jacalata commented 4 weeks ago

This seems like an internal bug, so I'll get someone to look into it there.