Skip to content

Commit 4ef158a

Browse files
authored
Merge pull request #339 from kayjan/feature/node-name-mandatory
Make Node name mandatory
2 parents c8f58a8 + 03764ce commit 4ef158a

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
## [Unreleased]
88
### Changed:
99
- Tree Search: Search relative path allows unix folder expression for leading sep symbol.
10+
- Node: Updated Node signature to reflect that name is mandatory.
1011

1112
## [0.23.0] - 2024-12-26
1213
### Changed:

bigtree/node/node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class Node(basenode.BaseNode):
7979
8080
"""
8181

82-
def __init__(self, name: str = "", sep: str = "/", **kwargs: Any):
82+
def __init__(self, name: str, sep: str = "/", **kwargs: Any):
8383
self.name = name
8484
self._sep = sep
8585
super().__init__(**kwargs)

tests/node/test_node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def tearDown(self):
4848

4949
def test_empty_node_name_error(self):
5050
with pytest.raises(exceptions.TreeError) as exc_info:
51-
node.Node()
51+
node.Node("")
5252
assert str(exc_info.value) == Constants.ERROR_NODE_NAME
5353

5454
def test_set_parent(self):

0 commit comments

Comments
 (0)