Scrapegraph-ai/scrapegraphai/utils/prettify_exec_info.py
Marco Vinciguerra fe3aa28fe7
Some checks failed
/ build (push) Has been cancelled
Release / Build (push) Has been cancelled
Release / Release (push) Has been cancelled
refactoring of the code
2024-09-11 16:04:43 +02:00

27 lines
782 B
Python

"""
Prettify the execution information of the graph.
"""
import pandas as pd
def prettify_exec_info(complete_result: list[dict]) -> pd.DataFrame:
"""
Transforms the execution information of a graph into a DataFrame for enhanced visualization.
Args:
complete_result (list[dict]): The complete execution information of the graph.
Returns:
pd.DataFrame: A DataFrame that organizes the execution information
for better readability and analysis.
Example:
>>> prettify_exec_info([{'node': 'A', 'status': 'success'},
{'node': 'B', 'status': 'failure'}])
DataFrame with columns 'node' and 'status' showing execution results for each node.
"""
df_nodes = pd.DataFrame(complete_result)
return df_nodes