Skip to content

Commit

Permalink
fix: sort path for get tree diff
Browse files Browse the repository at this point in the history
  • Loading branch information
kayjan committed Oct 16, 2024
1 parent d8fea80 commit a82b6d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bigtree/tree/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ def get_tree_diff(
(data_both[indicator_col] != "both")
| (data_both[path_col].isin(path_changes_deque))
]
data_both = data_both[[path_col]]
data_both = data_both[[path_col]].sort_values(path_col)
if len(data_both):
tree_diff = construct.dataframe_to_tree(
data_both, node_type=tree.__class__, sep=tree.sep
Expand Down
12 changes: 6 additions & 6 deletions tests/tree/test_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,12 @@ def test_tree_diff_sep_clash_with_node_name(tree_node):
tree_only_diff = helper.get_tree_diff(tree_node, other_tree_node)
expected_str = (
"a\n"
"├── b (-)\n"
"│ ├── d (-)\n"
" ── e (-)\n"
" ── g (-)\n"
" ── h (-)\n"
"└── /d (+)\n"
"├── /d (+)\n"
"── b (-)\n"
" ── d (-)\n"
" ── e (-)\n"
" ── g (-)\n"
" └── h (-)\n"
)
assert_print_statement(export.print_tree, expected_str, tree=tree_only_diff)

Expand Down

0 comments on commit a82b6d2

Please sign in to comment.