server-client-python
server-client-python copied to clipboard
server.favorites.add_favorite_workbook(user_item, workbook_item) returns resource conflict
Describe the bug server.favorites.add_favorite_workbook(user_item, workbook_item) returns resource conflict when multiple workbooks exist on a server with the same name, despite having different IDs. The workbooks have the same name but exist in different projects. A common example would be when a workbook or tableau server object (e.g., workbook, datasource, flow, etc.) exist in a production folder and also in a UAT/Test folder. A user may favorite both versions.
Versions Details of your environment, including:
- Tableau Server version: 2022.1
- Python version: Python 3.9.12
- TSC Version: 3.15
To Reproduce import tableauserverclient as tsc
Setup
token_name = 'some_token_name' token_value = 'some_token_value' tableau_auth = tsc.PersonalAccessTokenAuth(token_name=token_name, personal_access_token=token_value) server = tsc.Server('some_server') server.add_http_options({'verify': False})
with server.auth.sign_in(tableau_auth): server.use_highest_version() from_user = server.users.get_by_id('some_user_id') to_user = server.users.get_by_id('some_user_id') server.users.populate_favorites(from_user) server.users.populate_favorites(to_user) from_user_favorites = from_user.favorites for workbook in from_user_favorites['workbooks']: server.favorites.add_favorite_workbook(to_user, workbook)
Results What are the results or error messages received? ServerResponseError:
409007: Resource Conflict
A favorite already exists with the name 'some_name'
This looks like an internal error - I've asked the relevant team to look into it.
This will be fixed in an upcoming release.