Skip to content
This repository has been archived by the owner on Jan 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #804 from Avaiga/bug/fix-dn-multiple-values-for-na…
Browse files Browse the repository at this point in the history
…me-bug

bug/ fixed multiple values for "name" argument
  • Loading branch information
toan-quach authored Oct 26, 2023
2 parents c291c6f + b91b697 commit 28374bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/taipy/core/data/_data_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class _DataManager(_Manager[DataNode], _VersionMixin):
_ENTITY_NAME = DataNode.__name__
_EVENT_ENTITY_TYPE = EventEntityType.DATA_NODE
_repository: _DataFSRepository
__NAME_KEY = "name"

@classmethod
def _bulk_get_or_create(
Expand Down Expand Up @@ -95,6 +96,7 @@ def __create(
return cls.__DATA_NODE_CLASS_MAP[storage_type](
config_id=data_node_config.id,
scope=data_node_config.scope or DataNodeConfig._DEFAULT_SCOPE,
name=props.pop(cls.__NAME_KEY, None),
validity_period=data_node_config.validity_period,
owner_id=owner_id,
parent_ids=parent_ids,
Expand Down
5 changes: 5 additions & 0 deletions tests/core/data/test_data_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ def test_create_data_node_and_modify_properties_does_not_modify_config(self):
assert dn.properties.get("foo") == "bar"
assert dn.properties.get("baz") == "qux"

def test_create_data_node_with_name_provided(self):
dn_config = Config.configure_data_node(id="dn", foo="bar", name="acb")
dn = _DataManager._create_and_set(dn_config, None, None)
assert dn.name == "acb"

def test_create_and_get_csv_data_node(self):
# Test we can instantiate a CsvDataNode from DataNodeConfig with :
# - a csv type
Expand Down

0 comments on commit 28374bd

Please sign in to comment.