File tree Expand file tree Collapse file tree 1 file changed +26
-2
lines changed Expand file tree Collapse file tree 1 file changed +26
-2
lines changed Original file line number Diff line number Diff line change 33from enum import Enum
44from functools import lru_cache
55from io import TextIOWrapper
6+ import json
67from pathlib import Path
78from typing import (
89 Callable ,
@@ -470,10 +471,23 @@ def __init__(self, task: Task) -> None:
470471 self ._task = task
471472
472473 def __repr__ (self ):
473- return self ._task .__repr__ ()
474+ return f"<ExportTask ID: { self .uid } >" if getattr (
475+ self , "uid" , None ) else "<ExportTask>"
474476
475477 def __str__ (self ):
476- return self ._task .__str__ ()
478+ properties_to_include = [
479+ "completion_percentage" ,
480+ "created_at" ,
481+ "metadata" ,
482+ "name" ,
483+ "result" ,
484+ "status" ,
485+ "type" ,
486+ "uid" ,
487+ "updated_at" ,
488+ ]
489+ props = {prop : getattr (self , prop ) for prop in properties_to_include }
490+ return f"<ExportTask { json .dumps (props , indent = 4 , default = str )} >"
477491
478492 def __eq__ (self , other ):
479493 return self ._task .__eq__ (other )
@@ -511,6 +525,16 @@ def status(self):
511525 """Returns the status of the task."""
512526 return self ._task .status
513527
528+ @property
529+ def metadata (self ):
530+ """Returns the metadata of the task."""
531+ return self ._task .metadata
532+
533+ @property
534+ def result (self ):
535+ """Returns the result of the task."""
536+ return self ._task .result_url
537+
514538 @property
515539 def completion_percentage (self ):
516540 """Returns the completion percentage of the task."""
You can’t perform that action at this time.
0 commit comments