Repository: Avaiga/taipy
File: taipy/core/data/_data_manager.py (Python)

Code before:
            owner_id: Union[Optional[SequenceId], Optional[ScenarioId], Optional[CycleId]]
            if scope == Scope.SCENARIO:
                owner_id = scenario_id
            elif scope == Scope.CYCLE:
                owner_id = cycle_id
            else:
                owner_id = None
            dn_configs_and_owner_id.append((dn_config, owner_id))

        data_nodes = cls._repository._get_by_configs_and_owner_ids(
            dn_configs_and_owner_id, cls._build_filters_with_version(None)
        )

        return {
            dn_config: data_nodes.get((dn_config, owner_id)) or cls._create_and_set(dn_config, owner_id, None)
            for dn_config, owner_id in dn_configs_and_owner_id
        }

    @classmethod
    def _can_create(cls, config: Optional[DataNodeConfig] = None) -> Reasons:
        config_id = getattr(config, "id", None) or str(config)
        reason = Reasons(config_id)

        if config is not None:
            if not isinstance(config, DataNodeConfig):
                reason._add_reason(config_id, WrongConfigType(config_id, DataNodeConfig.__name__))
            elif config.scope is not Scope.GLOBAL:
                reason._add_reason(config_id, NotGlobalScope(config_id))

        return reason

    @classmethod
    def _create_and_set(
        cls, data_node_config: DataNodeConfig, owner_id: Optional[str], parent_ids: Optional[Set[str]]
    ) -> DataNode:
        data_node = cls.__create(data_node_config, owner_id, parent_ids)
        cls._set(data_node)
        Notifier.publish(_make_event(data_node, EventOperation.CREATION))
        return data_node

    @classmethod
    def __create(
        cls, data_node_config: DataNodeConfig, owner_id: Optional[str], parent_ids: Optional[Set[str]]
    ) -> DataNode:
        try:
            version = cls._get_latest_version()
            props = data_node_config._properties.copy()

            if data_node_config.storage_type:
                storage_type = data_node_config.storage_type
            else:

Review comment (bug):
Since the name difference between `Reasons` and `Reason` classes is only singular or plural, I would love it if the variables to match the class name to avoid future confusion.

```suggestion
                reasons._add_reason(config_id, WrongConfigType(config_id, DataNodeConfig.__name__))
```

Code after:
            owner_id: Union[Optional[SequenceId], Optional[ScenarioId], Optional[CycleId]]
            if scope == Scope.SCENARIO:
                owner_id = scenario_id
            elif scope == Scope.CYCLE:
                owner_id = cycle_id
            else:
                owner_id = None
            dn_configs_and_owner_id.append((dn_config, owner_id))

        data_nodes = cls._repository._get_by_configs_and_owner_ids(
            dn_configs_and_owner_id, cls._build_filters_with_version(None)
        )

        return {
            dn_config: data_nodes.get((dn_config, owner_id)) or cls._create_and_set(dn_config, owner_id, None)
            for dn_config, owner_id in dn_configs_and_owner_id
        }

    @classmethod
    def _can_create(cls, config: Optional[DataNodeConfig] = None) -> ReasonCollection:
        config_id = getattr(config, "id", None) or str(config)
        reason_collection = ReasonCollection()

        if config is not None:
            if not isinstance(config, DataNodeConfig):
                reason_collection._add_reason(config_id, WrongConfigType(config_id, DataNodeConfig.__name__))
            elif config.scope is not Scope.GLOBAL:
                reason_collection._add_reason(config_id, NotGlobalScope(config_id))

        return reason_collection

    @classmethod
    def _create_and_set(
        cls, data_node_config: DataNodeConfig, owner_id: Optional[str], parent_ids: Optional[Set[str]]
    ) -> DataNode:
        data_node = cls.__create(data_node_config, owner_id, parent_ids)
        cls._set(data_node)
        Notifier.publish(_make_event(data_node, EventOperation.CREATION))
        return data_node

    @classmethod
    def __create(
        cls, data_node_config: DataNodeConfig, owner_id: Optional[str], parent_ids: Optional[Set[str]]
    ) -> DataNode:
        try:
            version = cls._get_latest_version()
            props = data_node_config._properties.copy()

            if data_node_config.storage_type:
                storage_type = data_node_config.storage_type
            else: