diff --git a/tableauserverclient/server/request_factory.py b/tableauserverclient/server/request_factory.py index 209626051..720eb4085 100644 --- a/tableauserverclient/server/request_factory.py +++ b/tableauserverclient/server/request_factory.py @@ -182,10 +182,10 @@ def _generate_xml(self, datasource_item, connection_credentials=None, connection if connection_credentials is not None and connections is not None: raise RuntimeError("You cannot set both `connections` and `connection_credentials`") - if connection_credentials is not None: + if connection_credentials is not None and connection_credentials != False: _add_credentials_element(datasource_element, connection_credentials) - if connections is not None and len(connections) > 0: + if connections is not None and connections != False and len(connections) > 0: connections_element = ET.SubElement(datasource_element, "connections") for connection in connections: _add_connections_element(connections_element, connection) @@ -337,7 +337,7 @@ def _generate_xml(self, flow_item: "FlowItem", connections: Optional[List["Conne project_element = ET.SubElement(flow_element, "project") project_element.attrib["id"] = flow_item.project_id - if connections is not None: + if connections is not None and connections != False: connections_element = ET.SubElement(flow_element, "connections") for connection in connections: _add_connections_element(connections_element, connection) @@ -904,10 +904,10 @@ def _generate_xml( if connection_credentials is not None and connections is not None: raise RuntimeError("You cannot set both `connections` and `connection_credentials`") - if connection_credentials is not None: + if connection_credentials is not None and connection_credentials != False: _add_credentials_element(workbook_element, connection_credentials) - if connections is not None and len(connections) > 0: + if connections is not None and connections != False and len(connections) > 0: connections_element = ET.SubElement(workbook_element, "connections") for connection in connections: _add_connections_element(connections_element, connection)