Skip to content

Commit aeb033b

Browse files
committed
add certification to publishing a datasource
#1058
1 parent 6702799 commit aeb033b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tableauserverclient/server/request_factory.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
if TYPE_CHECKING:
1010
from tableauserverclient.server import Server
1111

12+
# this file could be largely replaced if we were willing to import the huge file from generateDS
13+
1214

1315
def _add_multipart(parts: Dict) -> Tuple[Any, str]:
1416
mime_multipart_parts = list()
@@ -146,7 +148,7 @@ def update_req(self, database_item):
146148

147149

148150
class DatasourceRequest(object):
149-
def _generate_xml(self, datasource_item, connection_credentials=None, connections=None):
151+
def _generate_xml(self, datasource_item: DatasourceItem, connection_credentials=None, connections=None):
150152
xml_request = ET.Element("tsRequest")
151153
datasource_element = ET.SubElement(xml_request, "datasource")
152154
datasource_element.attrib["name"] = datasource_item.name
@@ -159,6 +161,11 @@ def _generate_xml(self, datasource_item, connection_credentials=None, connection
159161
ask_data_element = ET.SubElement(datasource_element, "askData")
160162
ask_data_element.attrib["enablement"] = datasource_item.ask_data_enablement
161163

164+
if datasource_item.certified:
165+
datasource_element.attrib["isCertified"] = datasource_item.certified
166+
if datasource_item.certification_note:
167+
datasource_element.attrib["certificationNote"] = datasource_item.certification_note
168+
162169
project_element = ET.SubElement(datasource_element, "project")
163170
project_element.attrib["id"] = datasource_item.project_id
164171

0 commit comments

Comments
 (0)