Skip to content

Commit 9ddbad5

Browse files
committed
Add support for System schedule type
I'm not fully clear on where these might come from, but this change should let TSC work in such cases. Fixes #1349
1 parent d09a9ce commit 9ddbad5

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

tableauserverclient/models/schedule_item.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class Type:
2626
Subscription = "Subscription"
2727
DataAcceleration = "DataAcceleration"
2828
ActiveDirectorySync = "ActiveDirectorySync"
29+
System = "System"
2930

3031
class ExecutionOrder:
3132
Parallel = "Parallel"

test/assets/schedule_get.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
<schedule id="c9cff7f9-309c-4361-99ff-d4ba8c9f5467" name="Weekday early mornings" state="Active" priority="50" createdAt="2016-07-06T20:19:00Z" updatedAt="2016-09-13T11:00:32Z" type="Extract" frequency="Weekly" nextRunAt="2016-09-14T11:00:00Z" />
66
<schedule id="bcb79d07-6e47-472f-8a65-d7f51f40c36c" name="Saturday night" state="Active" priority="80" createdAt="2016-07-07T20:19:00Z" updatedAt="2016-09-12T16:39:38Z" type="Subscription" frequency="Weekly" nextRunAt="2016-09-18T06:00:00Z" />
77
<schedule id="f456e8f2-aeb2-4a8e-b823-00b6f08640f0" name="First of the month 1:00AM" state="Active" priority="50" createdAt="2019-02-19T18:52:19Z" updatedAt="2019-02-19T18:55:51Z" type="Flow" frequency="Monthly" nextRunAt="2019-03-01T09:00:00Z"/>
8+
<schedule id="3cfa4713-ce7c-4fa7-aa2e-f752bfc8dd04" name="First of the month 2:00AM" state="Active" priority="30" createdAt="2019-02-19T18:52:19Z" updatedAt="2019-02-19T18:55:51Z" type="System" frequency="Monthly" nextRunAt="2019-03-01T09:00:00Z"/>
89
</schedules>
910
</tsResponse>

test/test_schedule.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def test_get(self) -> None:
5050
extract = all_schedules[0]
5151
subscription = all_schedules[1]
5252
flow = all_schedules[2]
53+
system = all_schedules[3]
5354

5455
self.assertEqual(2, pagination_item.total_available)
5556
self.assertEqual("c9cff7f9-309c-4361-99ff-d4ba8c9f5467", extract.id)
@@ -79,6 +80,15 @@ def test_get(self) -> None:
7980
self.assertEqual("Flow", flow.schedule_type)
8081
self.assertEqual("2019-03-01T09:00:00Z", format_datetime(flow.next_run_at))
8182

83+
self.assertEqual("3cfa4713-ce7c-4fa7-aa2e-f752bfc8dd04", system.id)
84+
self.assertEqual("First of the month 2:00AM", system.name)
85+
self.assertEqual("Active", system.state)
86+
self.assertEqual(30, system.priority)
87+
self.assertEqual("2019-02-19T18:52:19Z", format_datetime(system.created_at))
88+
self.assertEqual("2019-02-19T18:55:51Z", format_datetime(system.updated_at))
89+
self.assertEqual("System", system.schedule_type)
90+
self.assertEqual("2019-03-01T09:00:00Z", format_datetime(system.next_run_at))
91+
8292
def test_get_empty(self) -> None:
8393
with open(GET_EMPTY_XML, "rb") as f:
8494
response_xml = f.read().decode("utf-8")

0 commit comments

Comments
 (0)