diff --git a/tableauserverclient/server/endpoint/workbooks_endpoint.py b/tableauserverclient/server/endpoint/workbooks_endpoint.py index 460017d1..53bf0c1a 100644 --- a/tableauserverclient/server/endpoint/workbooks_endpoint.py +++ b/tableauserverclient/server/endpoint/workbooks_endpoint.py @@ -280,7 +280,7 @@ def update( if include_view_acceleration_status: url += "?includeViewAccelerationStatus=True" - update_req = RequestFactory.Workbook.update_req(workbook_item) + update_req = RequestFactory.Workbook.update_req(workbook_item, self.parent_srv) server_response = self.put_request(url, update_req) logger.info(f"Updated workbook item (ID: {workbook_item.id})") updated_workbook = copy.copy(workbook_item) diff --git a/tableauserverclient/server/request_factory.py b/tableauserverclient/server/request_factory.py index f7bd139d..5849a8da 100644 --- a/tableauserverclient/server/request_factory.py +++ b/tableauserverclient/server/request_factory.py @@ -960,7 +960,7 @@ def _generate_xml( _add_hiddenview_element(views_element, view_name) return ET.tostring(xml_request) - def update_req(self, workbook_item): + def update_req(self, workbook_item, parent_srv: Optional["Server"] = None): xml_request = ET.Element("tsRequest") workbook_element = ET.SubElement(xml_request, "workbook") if workbook_item.name: @@ -973,6 +973,12 @@ def update_req(self, workbook_item): if workbook_item.owner_id: owner_element = ET.SubElement(workbook_element, "owner") owner_element.attrib["id"] = workbook_item.owner_id + if ( + workbook_item.description is not None + and parent_srv is not None + and parent_srv.check_at_least_version("3.21") + ): + workbook_element.attrib["description"] = workbook_item.description if workbook_item._views is not None: views_element = ET.SubElement(workbook_element, "views") for view in workbook_item.views: