Skip to content

Commit

Permalink
bugfix to build_url_parameter_string
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryant Howell committed Feb 17, 2020
1 parent 3e82963 commit df5685e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions tableau_rest_api/methods/rest_api_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,12 @@ def build_api_url(self, call: str, server_level: bool = False,
def build_url_parameter_string(map_dict: Optional[Dict] = None, name_value_tuple_list: Optional[List[Tuple]] = None,
hand_built_portion: Optional[str] = None):
encoded_list = None
if len(name_value_tuple_list) == 0:
encoded_list = None
else:
for v in name_value_tuple_list:
if len(v) != 2:
raise InvalidOptionException('Each element should have a two-element Tuples (Name, Value)')
encoded_list = urlencode(name_value_tuple_list)
if name_value_tuple_list is not None:
if len(name_value_tuple_list) > 0:
for v in name_value_tuple_list:
if len(v) != 2:
raise InvalidOptionException('Each element should have a two-element Tuples (Name, Value)')
encoded_list = urlencode(name_value_tuple_list)

if hand_built_portion is not None and encoded_list is None:
final_string = hand_built_portion
Expand Down

0 comments on commit df5685e

Please sign in to comment.