Skip to content

Commit 2082414

Browse files
committed
Add types to TaskItem
1 parent 613334b commit 2082414

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tableauserverclient/models/task_item.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from typing import List
2+
13
from defusedxml.ElementTree import fromstring
24

35
from tableauserverclient.datetime_helpers import parse_datetime
@@ -44,7 +46,7 @@ def __repr__(self):
4446
)
4547

4648
@classmethod
47-
def from_response(cls, xml, ns, task_type=Type.ExtractRefresh):
49+
def from_response(cls, xml, ns, task_type=Type.ExtractRefresh) -> List["TaskItem"]:
4850
parsed_response = fromstring(xml)
4951
all_tasks_xml = parsed_response.findall(".//t:task/t:{}".format(task_type), namespaces=ns)
5052

@@ -94,7 +96,7 @@ def _parse_element(cls, element, ns):
9496
)
9597

9698
@staticmethod
97-
def _translate_task_type(task_type):
99+
def _translate_task_type(task_type: str) -> str:
98100
if task_type in TaskItem._TASK_TYPE_MAPPING:
99101
return TaskItem._TASK_TYPE_MAPPING[task_type]
100102
else:

0 commit comments

Comments
 (0)