11#!/usr/bin/env python
22
3- # Copyright (c) 2023, 2024 Oracle and/or its affiliates.
3+ # Copyright (c) 2023, 2025 Oracle and/or its affiliates.
44# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
55
66
@@ -123,7 +123,6 @@ def make_model_card(model_name="", readme_path=""):
123123 )
124124 return rc .Group (
125125 rc .Text ("-" ),
126- columns = 1 ,
127126 )
128127
129128 try :
@@ -156,7 +155,6 @@ def make_model_card(model_name="", readme_path=""):
156155 return rc .Group (
157156 rc .Text (text ),
158157 eval_res_tb ,
159- columns = 2 ,
160158 )
161159
162160
@@ -216,7 +214,7 @@ def build_entity_df(entites, id) -> pd.DataFrame:
216214 "Type" : "-" ,
217215 "Redacted To" : "-" ,
218216 }
219- df = df . append ( df2 , ignore_index = True )
217+ df = pd . concat ([ df , pd . DataFrame ([ df2 ])] , ignore_index = True )
220218 return df
221219
222220
@@ -232,7 +230,6 @@ def build_report(self) -> rc.Group:
232230 self ._make_stats_card (),
233231 self ._make_text_card (),
234232 ],
235- type = rc .SelectType .TABS ,
236233 ),
237234 label = "Row Id: " + str (self .spec .id ),
238235 )
@@ -256,7 +253,7 @@ def _make_stats_card(self):
256253 index = True ,
257254 )
258255 )
259- return rc .Group (stats , label = "STATS" )
256+ return rc .Group (* stats , label = "STATS" )
260257
261258 def _make_text_card (self ):
262259 annotations = []
@@ -277,7 +274,7 @@ def _make_text_card(self):
277274 },
278275 return_html = True ,
279276 )
280- return rc .Group (rc .HTML (render_html ), label = "TEXT" )
277+ return rc .Group (rc .Html (render_html ), label = "TEXT" )
281278
282279
283280class PIIOperatorReport :
@@ -292,7 +289,7 @@ def __init__(self, report_spec: PiiReportSpec, report_uri: str):
292289 RowReportFields (r , report_spec .run_summary .show_sensitive_info )
293290 for r in rows
294291 ]
295-
292+ self . report_sections = None
296293 self .report_uri = report_uri
297294
298295 def make_view (self ):
@@ -317,7 +314,6 @@ def make_view(self):
317314 label = "Details" ,
318315 ),
319316 ],
320- type = rc .SelectType .TABS ,
321317 )
322318 )
323319 self .report_sections = [title_text , report_description , time_proceed , structure ]
@@ -331,7 +327,8 @@ def save_report(
331327 disable_print ()
332328 with rc .ReportCreator ("My Report" ) as report :
333329 report .save (
334- rc .Block (report_sections or self .report_sections ), report_local_path
330+ rc .Block (* (report_sections or self .report_sections )),
331+ report_local_path ,
335332 )
336333 enable_print ()
337334
@@ -354,7 +351,6 @@ def _build_summary_page(self):
354351 self ._make_yaml_card (),
355352 self ._make_model_card (),
356353 ],
357- type = rc .SelectType .TABS ,
358354 ),
359355 )
360356
@@ -367,7 +363,6 @@ def _build_details_page(self):
367363 blocks = [
368364 row .build_report () for row in self .rows_details
369365 ], # RowReportFields
370- type = rc .SelectType .DROPDOWN ,
371366 label = "Details" ,
372367 ),
373368 )
@@ -414,7 +409,6 @@ def _make_summary_stats_card(self) -> rc.Group:
414409 self .report_spec .run_summary .elapsed_time
415410 ),
416411 ),
417- columns = 2 ,
418412 ),
419413 rc .Heading ("Entities Distribution" , level = 3 ),
420414 plot_pie (self .report_spec .run_summary .statics ),
@@ -423,7 +417,7 @@ def _make_summary_stats_card(self) -> rc.Group:
423417 entites_df = self ._build_total_entity_df ()
424418 summary_stats .append (rc .Heading ("Resolved Entities" , level = 3 ))
425419 summary_stats .append (rc .DataTable (entites_df , index = True ))
426- return rc .Group (summary_stats , label = "STATS" )
420+ return rc .Group (* summary_stats , label = "STATS" )
427421
428422 def _make_yaml_card (self ) -> rc .Group :
429423 """Shows the full pii config yaml."""
@@ -449,13 +443,12 @@ def _make_model_card(self) -> rc.Group:
449443
450444 if len (model_cards ) <= 1 :
451445 return rc .Group (
452- model_cards ,
446+ * model_cards ,
453447 label = "MODEL CARD" ,
454448 )
455449 return rc .Group (
456450 rc .Select (
457451 model_cards ,
458- type = rc .SelectType .TABS ,
459452 ),
460453 label = "MODEL CARD" ,
461454 )
0 commit comments