@@ -231,19 +231,18 @@ def test_update_oncotree_code_tables_calls_update_with_expected_dataframes():
231231 # expected oncotree_code_distributiondf
232232 expected_df1 = pd .DataFrame (
233233 {
234- "Oncotree_Code" : ["BRCA" , "LUNG" , "SKIN" ],
235234 "DFCI" : [1 , 1 , 0 ],
236235 "MSK" : [0 , 1 , 1 ],
237236 "Total" : [1 , 2 , 1 ],
238- }
239- ).set_index ("Oncotree_Code" )
240- expected_df1 = expected_df1 .reset_index () # match the original index format
237+ "Oncotree_Code" : ["BRCA" , "LUNG" , "SKIN" ],
238+ },
239+ index = ["BRCA" , "LUNG" , "SKIN" ],
240+ )
241241
242242 # sort by Oncotree_Code to ensure deterministic order
243243 assert_frame_equal (
244- new_df1 .sort_values ("Oncotree_Code" ).reset_index (drop = True ),
245- expected_df1 .sort_values ("Oncotree_Code" ).reset_index (drop = True ),
246- check_dtype = False ,
244+ new_df1 ,
245+ expected_df1 ,
247246 )
248247
249248 # Second call = primary_code_distributiondf update
@@ -263,18 +262,17 @@ def test_update_oncotree_code_tables_calls_update_with_expected_dataframes():
263262 # expected primary_code_distributiondf
264263 expected_df2 = pd .DataFrame (
265264 {
266- "Oncotree_Code" : ["BREAST" , "LUNG" , "SKIN" ],
267265 "DFCI" : [1 , 1 , 0 ],
268266 "MSK" : [0 , 1 , 1 ],
269267 "Total" : [1 , 2 , 1 ],
270- }
271- ).set_index ("Oncotree_Code" )
272- expected_df2 = expected_df2 .reset_index ()
268+ "Oncotree_Code" : ["BREAST" , "LUNG" , "SKIN" ],
269+ },
270+ index = ["BREAST" , "LUNG" , "SKIN" ],
271+ )
273272
274273 assert_frame_equal (
275- new_df2 .sort_values ("Oncotree_Code" ).reset_index (drop = True ),
276- expected_df2 .sort_values ("Oncotree_Code" ).reset_index (drop = True ),
277- check_dtype = False ,
274+ new_df2 ,
275+ expected_df2 ,
278276 )
279277
280278 # Verify _update_table was called with to_delete=True
0 commit comments