@@ -400,7 +400,7 @@ def print_results(results: Dict) -> str:
400
400
401
401
"""
402
402
403
- def to_str (v : Union [str , tuple ]) -> str :
403
+ def to_str (v : Union [str , tuple , int , float ]) -> str :
404
404
if isinstance (v , str ):
405
405
return v
406
406
elif isinstance (v , tuple ):
@@ -412,12 +412,14 @@ def odict_to_str(d: Mapping) -> str:
412
412
return out
413
413
414
414
others = {
415
- k : odict_to_str (v ) if isinstance (v , OrderedDict ) else v for k , v in results ["event_handlers_stats" ].items ()
415
+ k : odict_to_str (v ) if isinstance (v , OrderedDict ) else to_str (v )
416
+ for k , v in results ["event_handlers_stats" ].items ()
416
417
}
417
418
418
419
others .update (results ["event_handlers_names" ])
419
420
420
- output_message = """
421
+ output_message : str = (
422
+ """
421
423
----------------------------------------------------
422
424
| Time profiling stats (in seconds): |
423
425
----------------------------------------------------
@@ -430,7 +432,7 @@ def odict_to_str(d: Mapping) -> str:
430
432
{dataflow_stats}
431
433
432
434
Event handlers:
433
- {total_time:.5f }
435
+ {total_time}
434
436
435
437
- Events.STARTED: {STARTED_names}
436
438
{STARTED}
@@ -450,9 +452,10 @@ def odict_to_str(d: Mapping) -> str:
450
452
- Events.COMPLETED: {COMPLETED_names}
451
453
{COMPLETED}
452
454
""" .format (
453
- processing_stats = odict_to_str (results ["processing_stats" ]),
454
- dataflow_stats = odict_to_str (results ["dataflow_stats" ]),
455
- ** others ,
455
+ processing_stats = odict_to_str (results ["processing_stats" ]),
456
+ dataflow_stats = odict_to_str (results ["dataflow_stats" ]),
457
+ ** others ,
458
+ )
456
459
)
457
460
print (output_message )
458
461
return output_message
0 commit comments