Skip to content

Commit

Permalink
updated non-existing int values to -1
Browse files Browse the repository at this point in the history
  • Loading branch information
movsesyanae committed Nov 8, 2024
1 parent 02a00e5 commit 27e95f8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pipit/readers/core_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,19 @@ def finalize(self):
# create a dataframe
trace_df = pandas.DataFrame(all_events)

trace_df["_matching_event"].fillna(-1, inplace=True)
trace_df["_parent"].fillna(-1, inplace=True)
trace_df["_matching_timestamp"].fillna(-1, inplace=True)

# categorical for memory savings
trace_df = trace_df.astype(
{
"Name": "category",
"Event Type": "category",
"Process": "category",
"_matching_event": "Int32",
"_parent": "Int32",
"_matching_timestamp": "Int32",
"_matching_event": "int32",
"_parent": "int32",
"_matching_timestamp": "int32",
}
)
return trace_df
Expand All @@ -115,7 +119,7 @@ def __update_parent_child_relationships(
"""
if len(stack) == 0:
# root event
event["_parent"] = numpy.nan
event["_parent"] = -1
else:
parent_event = event_list[stack[-1]]
event["_parent"] = parent_event["unique_id"]
Expand Down

0 comments on commit 27e95f8

Please sign in to comment.