66class ExtractItem :
77 """
88 An extract refresh task item.
9-
9+
1010 Attributes
1111 ----------
1212 id : str
@@ -22,11 +22,7 @@ class ExtractItem:
2222 """
2323
2424 def __init__ (
25- self ,
26- priority : int ,
27- refresh_type : str ,
28- workbook_id : Optional [str ] = None ,
29- datasource_id : Optional [str ] = None
25+ self , priority : int , refresh_type : str , workbook_id : Optional [str ] = None , datasource_id : Optional [str ] = None
3026 ):
3127 self ._id : Optional [str ] = None
3228 self ._priority = priority
@@ -65,22 +61,22 @@ def from_xml_element(cls, parsed_response: ET.Element, ns: dict) -> List["Extrac
6561 """Create ExtractItem objects from XML element."""
6662 all_extract_items = []
6763 all_extract_xml = parsed_response .findall (".//t:extract" , namespaces = ns )
68-
64+
6965 for extract_xml in all_extract_xml :
7066 extract_id = extract_xml .get ("id" , None )
7167 priority = int (extract_xml .get ("priority" , 0 ))
7268 refresh_type = extract_xml .get ("type" , None )
73-
69+
7470 # Check for workbook or datasource
7571 workbook_elem = extract_xml .find (".//t:workbook" , namespaces = ns )
7672 datasource_elem = extract_xml .find (".//t:datasource" , namespaces = ns )
77-
73+
7874 workbook_id = workbook_elem .get ("id" , None ) if workbook_elem is not None else None
7975 datasource_id = datasource_elem .get ("id" , None ) if datasource_elem is not None else None
80-
76+
8177 extract_item = cls (priority , refresh_type , workbook_id , datasource_id )
8278 extract_item ._id = extract_id
83-
79+
8480 all_extract_items .append (extract_item )
85-
86- return all_extract_items
81+
82+ return all_extract_items
0 commit comments