Skip to content

Commit

Permalink
Merge pull request bryanthowell-tableau#84 from bryantbhowell/5.1.1
Browse files Browse the repository at this point in the history
5.1.1
  • Loading branch information
Bryant Howell authored Feb 17, 2020
2 parents 35f52bd + 4235b2a commit c5a4332
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion tableau_rest_api/methods/datasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def update_datasource_connection_by_luid(self, datasource_luid: str, new_server_
new_connection_username: Optional[str] = None,
new_connection_password: Optional[str] = None) -> ET.Element:
self.start_log_block()
tsr = self.__build_connection_update_xml(new_server_address, new_server_port,
tsr = self.rest_api_base.__build_connection_update_xml(new_server_address, new_server_port,
new_connection_username,
new_connection_password)
url = self.build_api_url("datasources/{}/connection".format(datasource_luid))
Expand Down
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
2 changes: 1 addition & 1 deletion tableau_rest_api/methods/workbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def update_workbook_connection_by_luid(self, wb_luid: str, connection_luid: str,
new_connection_username: Optional[str] = None,
new_connection_password: Optional[str] = None) -> ET.Element:
self.start_log_block()
tsr = self.__build_connection_update_xml(new_server_address, new_server_port, new_connection_username,
tsr = self.rest_api_base.__build_connection_update_xml(new_server_address, new_server_port, new_connection_username,
new_connection_password)
url = self.build_api_url("workbooks/{}/connections/{}".format(wb_luid, connection_luid))
response = self.send_update_request(url, tsr)
Expand Down

0 comments on commit c5a4332

Please sign in to comment.