divinorum-webb / tableau-api-lib

An API library that allows developers to call on the methods listed in Tableau's REST API documentation.
MIT License
96 stars 34 forks source link

parameter_dict not working for get_users_on_site() #54

Closed Subhash-Daggubati closed 3 years ago

Subhash-Daggubati commented 3 years ago

There is no difference in the response for the following lines of code.

conn.get_users_on_site() conn.get_users_on_site(parameter_dict={'fields':'all'})

Based on Tableau REST API documentation, when the fields parameter with value all is passed, the response should also have email and Full Name details. But it is returning the default response.

https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_concepts_fields.htm#get-users_site

divinorum-webb commented 3 years ago

Hi @Subhash-Daggubati if a parameter that does not map to any functionality is passed then there will be no impact on Tableau's side. In your example, you would want to be specifying fields=_all_.

You would need to define your parameter dict in this case as {"<your_chosen_param_label>": "fields=_all_"}.

At the surface it seems that the "fields" should just be the key of the dict, and then the value you are setting for "fields" should be the value in the key/value pair, but this does not generalize to other values that can be specified to append to URL requests. The existing parameter_dict configuration generalizes to specifying filters ("vf_=) as well as specifying things like PDF parameters.

You could argue that the above issue could be handled by making filter keys follow the "vf_" pattern instead, but this is a decision with tradeoffs that require the user to split their filter syntax into two different string values instead of one so I do not think it is an improvement and it would also be a breaking change for others who are using the existing format.