Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions thicket/tests/test_filter_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ def check_filter_stats(th, columns_values):
# We can't check th.graph because of squash in filter_stats
assert th.statsframe.graph is not new_th.statsframe.graph

# Check Thicket and Statsframe graph in sync
assert len(new_th.graph) == len(new_th.statsframe.graph)

# filtered nodes in aggregated statistics table
stats_nodes = sorted(
new_th.statsframe.dataframe.index.drop_duplicates().tolist()
Expand Down
3 changes: 3 additions & 0 deletions thicket/thicket.py
Original file line number Diff line number Diff line change
Expand Up @@ -1662,7 +1662,10 @@ def filter_stats(self, filter_function):
]

# filter nodes in the graphframe based on the dataframe nodes
# We want to preserve columns, so "new_statsframe=False",
# however to match graph filter we update statsframe.graph
new_thicket = new_thicket.squash(new_statsframe=False)
new_thicket.statsframe.graph = new_thicket.graph

return new_thicket

Expand Down
Loading