Skip to content

Commit

Permalink
fix no leaf match error
Browse files Browse the repository at this point in the history
  • Loading branch information
ASEM000 committed Mar 29, 2024
1 parent 7401cae commit a4615cf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sepes/_src/tree_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ def broadcast(self): ...
"""

_NO_LEAF_MATCH = """\
No leaf match is found for where={where}. Available keys are {names}.
No leaf match is found for where={where}. Available keys are {names}.
No leaf match is found for where={where}, Available keys are {names}
Check the following:
- If where is `str` then check if the key exists as a key or attribute.
- If where is `int` then check if the index is in range.
Expand Down Expand Up @@ -170,8 +169,9 @@ def path_map_func(path, leaf):

if not match:
path_leaf, _ = treelib.path_flatten(tree, is_leaf=is_leaf)
path = "/".join(str(where_i.input) for where_i in where)
names = "".join("\n - " + treelib.keystr(path) for path, _ in path_leaf)
raise LookupError(_NO_LEAF_MATCH.format(where=where, names=names))
raise LookupError(_NO_LEAF_MATCH.format(where=path, names=names))

return mask

Expand Down

0 comments on commit a4615cf

Please sign in to comment.