1
1
#!/usr/bin/env python
2
2
3
- # Copyright (c) 2023, 2024 Oracle and/or its affiliates.
3
+ # Copyright (c) 2023, 2025 Oracle and/or its affiliates.
4
4
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
5
5
6
6
@@ -123,7 +123,6 @@ def make_model_card(model_name="", readme_path=""):
123
123
)
124
124
return rc .Group (
125
125
rc .Text ("-" ),
126
- columns = 1 ,
127
126
)
128
127
129
128
try :
@@ -156,7 +155,6 @@ def make_model_card(model_name="", readme_path=""):
156
155
return rc .Group (
157
156
rc .Text (text ),
158
157
eval_res_tb ,
159
- columns = 2 ,
160
158
)
161
159
162
160
@@ -216,7 +214,7 @@ def build_entity_df(entites, id) -> pd.DataFrame:
216
214
"Type" : "-" ,
217
215
"Redacted To" : "-" ,
218
216
}
219
- df = df . append ( df2 , ignore_index = True )
217
+ df = pd . concat ([ df , pd . DataFrame ([ df2 ])] , ignore_index = True )
220
218
return df
221
219
222
220
@@ -232,7 +230,6 @@ def build_report(self) -> rc.Group:
232
230
self ._make_stats_card (),
233
231
self ._make_text_card (),
234
232
],
235
- type = rc .SelectType .TABS ,
236
233
),
237
234
label = "Row Id: " + str (self .spec .id ),
238
235
)
@@ -256,7 +253,7 @@ def _make_stats_card(self):
256
253
index = True ,
257
254
)
258
255
)
259
- return rc .Group (stats , label = "STATS" )
256
+ return rc .Group (* stats , label = "STATS" )
260
257
261
258
def _make_text_card (self ):
262
259
annotations = []
@@ -277,7 +274,7 @@ def _make_text_card(self):
277
274
},
278
275
return_html = True ,
279
276
)
280
- return rc .Group (rc .HTML (render_html ), label = "TEXT" )
277
+ return rc .Group (rc .Html (render_html ), label = "TEXT" )
281
278
282
279
283
280
class PIIOperatorReport :
@@ -292,7 +289,7 @@ def __init__(self, report_spec: PiiReportSpec, report_uri: str):
292
289
RowReportFields (r , report_spec .run_summary .show_sensitive_info )
293
290
for r in rows
294
291
]
295
-
292
+ self . report_sections = None
296
293
self .report_uri = report_uri
297
294
298
295
def make_view (self ):
@@ -317,7 +314,6 @@ def make_view(self):
317
314
label = "Details" ,
318
315
),
319
316
],
320
- type = rc .SelectType .TABS ,
321
317
)
322
318
)
323
319
self .report_sections = [title_text , report_description , time_proceed , structure ]
@@ -331,7 +327,8 @@ def save_report(
331
327
disable_print ()
332
328
with rc .ReportCreator ("My Report" ) as report :
333
329
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 ,
335
332
)
336
333
enable_print ()
337
334
@@ -354,7 +351,6 @@ def _build_summary_page(self):
354
351
self ._make_yaml_card (),
355
352
self ._make_model_card (),
356
353
],
357
- type = rc .SelectType .TABS ,
358
354
),
359
355
)
360
356
@@ -367,7 +363,6 @@ def _build_details_page(self):
367
363
blocks = [
368
364
row .build_report () for row in self .rows_details
369
365
], # RowReportFields
370
- type = rc .SelectType .DROPDOWN ,
371
366
label = "Details" ,
372
367
),
373
368
)
@@ -414,7 +409,6 @@ def _make_summary_stats_card(self) -> rc.Group:
414
409
self .report_spec .run_summary .elapsed_time
415
410
),
416
411
),
417
- columns = 2 ,
418
412
),
419
413
rc .Heading ("Entities Distribution" , level = 3 ),
420
414
plot_pie (self .report_spec .run_summary .statics ),
@@ -423,7 +417,7 @@ def _make_summary_stats_card(self) -> rc.Group:
423
417
entites_df = self ._build_total_entity_df ()
424
418
summary_stats .append (rc .Heading ("Resolved Entities" , level = 3 ))
425
419
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" )
427
421
428
422
def _make_yaml_card (self ) -> rc .Group :
429
423
"""Shows the full pii config yaml."""
@@ -449,13 +443,12 @@ def _make_model_card(self) -> rc.Group:
449
443
450
444
if len (model_cards ) <= 1 :
451
445
return rc .Group (
452
- model_cards ,
446
+ * model_cards ,
453
447
label = "MODEL CARD" ,
454
448
)
455
449
return rc .Group (
456
450
rc .Select (
457
451
model_cards ,
458
- type = rc .SelectType .TABS ,
459
452
),
460
453
label = "MODEL CARD" ,
461
454
)
0 commit comments