Skip to content

Commit

Permalink
fix(common): Node.map_clear should have return type annotation Any (
Browse files Browse the repository at this point in the history
#8564)

Previously `Node.map_clear` had a `dict` return type annotation, just as
`Node.map`, even though the main rationale behind `map_clear` is that it
returns only the result of the root node and discards all the
intermediaries.
  • Loading branch information
peter-gy authored Mar 6, 2024
1 parent 12adb4b commit 8d7baae
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions ibis/common/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,7 @@ def map(self, fn: Callable, filter: Optional[Finder] = None) -> dict[Node, Any]:
return results

@experimental
def map_clear(
self, fn: Callable, filter: Optional[Finder] = None
) -> dict[Node, Any]:
def map_clear(self, fn: Callable, filter: Optional[Finder] = None) -> Any:
"""Apply a function to all nodes in the graph more memory efficiently.
Alternative implementation of `map` to reduce memory usage. While `map` keeps
Expand Down

0 comments on commit 8d7baae

Please sign in to comment.