8000 Merge branch 'development' into 1354-daily-interval-tasks · LehmD/server-client-python@b06a7a2 · GitHub
[go: up one dir, main page]

Skip to content

Commit b06a7a2

Browse files
authored
Merge branch 'development' into 1354-daily-interval-tasks
2 parents 0dca1aa + 65443eb commit b06a7a2

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

tableauserverclient/models/workbook_item.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ def created_at(self) -> Optional[datetime.datetime]:
9191
def description(self) -> Optional[str]:
9292
return self._description
9393

94+
@description.setter
95+
def description(self, value: str):
96+
self._description = value
97+
9498
@property
9599
def id(self) -> Optional[str]:
96100
return self._id

tableauserverclient/server/request_factory.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,9 @@ def _generate_xml(
911911
for connection in connections:
912912
_add_connections_element(connections_element, connection)
913913

914+
if workbook_item.description is not None:
915+
workbook_element.attrib["description"] = workbook_item.description
916+
914917
if hidden_views is not 8000 None:
915918
import warnings
916919

test/assets/workbook_publish.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version='1.0' encoding='UTF-8'?>
22
<tsResponse xmlns="http://tableau.com/api" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tableau.com/api http://tableau.com/api/ts-api-2.3.xsd">
3-
<workbook id="a8076ca1-e9d8-495e-bae6-c684dbb55836" name="RESTAPISample" contentUrl="RESTAPISample_0" showTabs="false" size="1" createdAt="2016-08-18T18:33:24Z" updatedAt="2016-08-18T20:31:34Z">
3+
<workbook id="a8076ca1-e9d8-495e-bae6-c684dbb55836" name="RESTAPISample" contentUrl="RESTAPISample_0" showTabs="false" size="1" createdAt="2016-08-18T18:33:24Z" updatedAt="2016-08-18T20:31:34Z" description="REST API Testing">
44
<project id="ee8c6e70-43b6-11e6-af4f-f7b0d8e20760" name="default" />
55
<owner id="5de011f8-5aa9-4d5b-b991-f462c8dd6bb7" />
66
<tags />
77
<views>
88
<view id="fe0b4e89-73f4-435e-952d-3a263fbfa56c" name="GDP per capita" contentUrl="RESTAPISample_0/sheets/GDPpercapita" />
99
</views>
1010
</workbook>
11-
</tsResponse>
11+
</tsResponse>

test/test_workbook.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,8 @@ def test_publish(self) -> None:
488488
name="Sample", show_tabs=False, project_id="ee8c6e70-43b6-11e6-af4f-f7b0d8e20760"
489489
)
490490

491+
new_workbook.description = "REST API Testing"
492+
491493
sample_workbook = os.path.join(TEST_ASSET_DIR, "SampleWB.twbx")
492494
publish_mode = self.server.PublishMode.CreateNew
493495

@@ -506,6 +508,7 @@ def test_publish(self) -> None:
506508
self.assertEqual("fe0b4e89-73f4-435e-952d-3a263fbfa56c", new_workbook.views[0].id)
507509
self.assertEqual("GDP per capita", new_workbook.views[0].name)
508510
self.assertEqual("RESTAPISample_0/sheets/GDPpercapita", new_workbook.views[0].content_url)
511+
self.assertEqual("REST API Testing", new_workbook.description)
509512

510513
def test_publish_a_packaged_file_object(self) -> None:
511514
with open(PUBLISH_XML, "rb") as f:

0 commit comments

Comments
 (0)
0