8000 Do not create empty connections list by jacalata · Pull Request #1178 · tableau/server-client-python · GitHub
[go: up one dir, main page]

Skip to content

Do not create empty connections list #1178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions tableauserverclient/server/request_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
0