Skip to content

Commit 600a0b7

Browse files
committed
Permit missing tasks missing schedule
1 parent e65ca39 commit 600a0b7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tableauserverclient/models/task_item.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ def _parse_element(cls, element, ns):
6565
last_run_at_element = element.find(".//t:lastRunAt", namespaces=ns)
6666

6767
schedule_item_list = ScheduleItem.from_element(element, ns)
68-
if len(schedule_item_list) >= 1:
69-
schedule_item = schedule_item_list[0]
68+
schedule_item = next(iter(schedule_item_list), None)
7069

7170
# according to the Tableau Server REST API documentation,
7271
# there should be only one of workbook or datasource
@@ -90,7 +89,7 @@ def _parse_element(cls, element, ns):
9089
task_type,
9190
priority,
9291
consecutive_failed_count,
93-
schedule_item.id,
92+
schedule_item.id if schedule_item is not None else None,
9493
schedule_item,
9594
last_run_at,
9695
target,

0 commit comments

Comments
 (0)