-
Notifications
You must be signed in to change notification settings - Fork 448
Closed
Labels
Description
Hi, I tried to find user by user name using request options however I still got errors until I tried to quote_plus the user name string.
Task:
Find user via user name
[email protected]
Steps
import tableauserverclient as tsc
# .. server sign in etc..
request_options = tsc.RequestOptions()
request_options.filter.add(
tsc.Filter(
tsc.RequestOptions.Field.Name,
tsc.RequestOptions.Operator.Equals,
'[email protected]'
)
)
users, pagination_item = server.users.get(request_options)
print(users)Expected result
[<User ada95cbc-ca59-4087-bbfe-acbcf55d88a4 [email protected] role=Creator>]
Actual result
[]
This is due to the character + in username.
I'm using quote_plus as a workaround.
import tableauserverclient as tsc
from urllib.parse import quote_plus
# .. server sign in etc..
request_options = tsc.RequestOptions()
request_options.filter.add(
tsc.Filter(
tsc.RequestOptions.Field.Name,
tsc.RequestOptions.Operator.Equals,
quote_plus('[email protected]')
)
)
users, pagination_item = server.users.get(request_options)
print(users)
# [<User ada95cbc-ca59-4087-bbfe-acbcf55d88a4 [email protected] role=Creator>]
mark-thompson, adam-rudd-myob and holzben