@@ -57,7 +57,7 @@ def results() -> List[Result]:
5757 workspace = uuid .uuid1 ().hex ,
5858 ),
5959 Result (
60- status = Status . FAILED ( ),
60+ status = Status ( status_type = StatusType . CUSTOM , status_name = "custom_status" ),
6161 started_at = datetime .datetime (
6262 2018 , 5 , 7 , 18 , 58 , 5 , 219692 , tzinfo = datetime .timezone .utc
6363 ),
@@ -91,8 +91,7 @@ def test__convert_results_with_all_fields_to_dataframe__returns_whole_results_da
9191 pd .testing .assert_frame_equal (
9292 results_dataframe , expected_results_dataframe , check_dtype = True
9393 )
94- assert results_dataframe ["status.status_type" ].dtype == "object"
95- assert isinstance (results_dataframe ["status.status_type" ].iloc [0 ], StatusType )
94+ assert isinstance (results_dataframe ["status" ].iloc [0 ], str )
9695 assert results_dataframe ["started_at" ].dtype == "datetime64[ns, UTC]"
9796 assert results_dataframe ["updated_at" ].dtype == "datetime64[ns, UTC]"
9897 assert results_dataframe ["file_ids" ].dtype == "object"
@@ -117,8 +116,7 @@ def test__convert_results_with_specific_fields_to_dataframe__returns_results_dat
117116 pd .testing .assert_frame_equal (
118117 results_dataframe , expected_results_dataframe , check_dtype = True
119118 )
120- assert results_dataframe ["status.status_type" ].dtype == "object"
121- assert isinstance (results_dataframe ["status.status_type" ].iloc [0 ], StatusType )
119+ assert isinstance (results_dataframe ["status" ].iloc [0 ], str )
122120 assert results_dataframe ["started_at" ].dtype == "datetime64[ns, UTC]"
123121 assert results_dataframe ["updated_at" ].dtype == "datetime64[ns, UTC]"
124122 assert results_dataframe ["file_ids" ].dtype == "object"
@@ -143,8 +141,7 @@ def test__convert_results_to_dataframe_with_id_index__returns_results_dataframe_
143141 pd .testing .assert_frame_equal (
144142 results_dataframe , expected_results_dataframe , check_dtype = True
145143 )
146- assert results_dataframe ["status.status_type" ].dtype == "object"
147- assert isinstance (results_dataframe ["status.status_type" ].iloc [0 ], StatusType )
144+ assert isinstance (results_dataframe ["status" ].iloc [0 ], str )
148145 assert results_dataframe ["started_at" ].dtype == "datetime64[ns, UTC]"
149146 assert results_dataframe ["updated_at" ].dtype == "datetime64[ns, UTC]"
150147 assert results_dataframe ["file_ids" ].dtype == "object"
@@ -165,6 +162,10 @@ def test__convert_results_to_dataframe_with_no_results__returns_empty_dataframe(
165162 def __get_expected_results_dataframe (self , results : List [Result ]):
166163 results_dict = []
167164 for result in results :
165+ status = (
166+ {f"status" : result .status .status_type .value if result .status .status_type
167+ != "CUSTOM" else result .status .status_name }
168+ )
168169 status_type_summary = (
169170 {
170171 f"status_type_summary.{ key } " : value
@@ -180,6 +181,7 @@ def __get_expected_results_dataframe(self, results: List[Result]):
180181 )
181182 results_dict .append (
182183 {
184+ ** status ,
183185 ** {
184186 "started_at" : result .started_at ,
185187 "updated_at" : result .updated_at ,
@@ -195,12 +197,6 @@ def __get_expected_results_dataframe(self, results: List[Result]):
195197 "file_ids" : result .file_ids ,
196198 "data_table_ids" : result .data_table_ids ,
197199 "workspace" : result .workspace ,
198- "status.status_type" : (
199- result .status .status_type if result .status else None
200- ),
201- "status.status_name" : (
202- result .status .status_name if result .status else None
203- ),
204200 },
205201 ** status_type_summary ,
206202 ** properties ,
0 commit comments