You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the ?fields= url param in the REST API could return the missing UserItem fields. However it seems at this time the TableauServerClient currently does not support adding fields to the request param.
# If I could edit the .baseurl for the .get() method, then maybe that# would work? Alas, cannot edit an attributeurl=server.users.baseurlurl_with_fullname=url+'?fields=_all_'server_response=server.users.get_request(url_with_fullname, None)
all_user_items=TSC.UserItem.from_response(server_response.content,
server.users.parent_srv.namespace)
print("User name: '{}' fullname: '{}', User email: '{}'".format(all_user_items[0].name,
all_user_items[0].fullname,
all_user_items[0].email))
# =># User name: 'username123' fullname: 'User Name', User email: 'user.name@email.com'
Do you think changing the baseurl to have the _all_ fields by default is a good idea?
My opinion is I find it annoying that the UserItem object returns different fields based on which get method you use. Nevermind that one field never returns.
Personally, I don't see much difference with only 2 more short fields(email and fullname) added to the object memory space. And even then most times developers are going to be using the pagination feature.
# If I could edit the .baseurl for the .get() method, then maybe that# would work? Alas, cannot edit an attributeurl=server.users.baseurlurl_with_fullname=url+'?fields=_all_'server_response=server.users.get_request(url_with_fullname, None)
all_user_items=TSC.UserItem.from_response(server_response.content,
server.users.parent_srv.namespace)
print("User name: '{}' fullname: '{}', User email: '{}'".format(all_user_items[0].name,
all_user_items[0].fullname,
all_user_items[0].email))
# =># User name: 'username123' fullname: 'User Name', User email: 'user.name@email.com'
I've found this only brings back the first 100 results due to the API's pagination.
I m writing a production software, and need to update email and full name in some cases. This bug causes me to update those fields everytime, since those fields return 'None'.
I probably shouldnt hack my way through it. Waiting for a fix....
Activity
RyanSnodgrass commentedon Feb 7, 2020
It seems maybe the
_make_request()method in the Endpoint class has support for parametersserver-client-python/tableauserverclient/server/endpoint/endpoint.py
Line 42 in a6cc77d
RyanSnodgrass commentedon Feb 7, 2020
I'm trying to hack my way through this.
This actually works!
RyanSnodgrass commentedon Feb 7, 2020
Feature request to add the fields we want returned from the
.get()and.get_by_id()methods.RyanSnodgrass commentedon Feb 7, 2020
Do you think changing the baseurl to have the
_all_fields by default is a good idea?My opinion is I find it annoying that the UserItem object returns different fields based on which get method you use. Nevermind that one field never returns.
Personally, I don't see much difference with only 2 more short fields(email and fullname) added to the object memory space. And even then most times developers are going to be using the pagination feature.
RyanSnodgrass commentedon Feb 10, 2020
I've found this only brings back the first 100 results due to the API's pagination.
hariszhr commentedon Mar 19, 2020
I m writing a production software, and need to update email and full name in some cases. This bug causes me to update those fields everytime, since those fields return 'None'.
I probably shouldnt hack my way through it. Waiting for a fix....
shinchris commentedon Dec 18, 2020
See #278 for updates