Repository: kedro-org/kedro
File: kedro/io/kedro_data_catalog.py (Python)

Code before:
            save_version: Version string to be used for ``save`` operations
                by all datasets with enabled versioning. It must: a) be a
                case-insensitive string that conforms with operating system
                filename limitations, b) always return the latest version when
                sorted in lexicographical order.

        Example:
        ::
            >>> from kedro_datasets.pandas import CSVDataset
            >>>
            >>> cars = CSVDataset(filepath="cars.csv",
            >>>                   load_args=None,
            >>>                   save_args={"index": False})
            >>> catalog = KedroDataCatalog(datasets={"cars": cars})
        """
        warnings.warn(
            "`KedroDataCatalog` is currently an experimental feature and will replace the existing `DataCatalog` "
            "in Kedro 1.0.0, while adopting the original `DataCatalog` name. Several APIs have been temporarily "
            "retained in `KedroDataCatalog` for compatibility with the old `DataCatalog`, including the `datasets` "
            "property and the `get_datasets`, `_get_datasets`, `add, list`, `add_feed_dict`, and `shallow_copy` "
            "methods. These will be removed or replaced with updated alternatives in Kedro 1.0.0. "
            "For more details, refer to the documentation: "
            "https://docs.kedro.org/en/stable/data/index.html#kedrodatacatalog-experimental-feature",
            KedroDeprecationWarning,
            stacklevel=2,
        )
        self._config_resolver = config_resolver or CatalogConfigResolver()
        # TODO: rename back to _datasets when removing old catalog
        self.__datasets: dict[str, AbstractDataset] = datasets or {}
        self._lazy_datasets: dict[str, _LazyDataset] = {}
        self._load_versions, self._save_version = _validate_versions(
            datasets, load_versions or {}, save_version
        )

        self._use_rich_markup = _has_rich_handler()

        for ds_name, ds_config in self._config_resolver.config.items():
            self._add_from_config(ds_name, ds_config)

        raw_data = raw_data or {}
        for ds_name, data in raw_data.items():
            self[ds_name] = data  # type: ignore[has-type]

    @property
    def datasets(self) -> dict[str, Any]:
        # TODO: remove when removing old catalog
        return self._lazy_datasets | self.__datasets

    @datasets.setter
    def datasets(self, value: Any) -> None:
        # TODO: remove when removing old catalog

Review comment (suggestion):
Maybe

```suggestion
        warnings.warn(
            "`KedroDataCatalog` is currently an experimental feature and will replace the existing `DataCatalog` "
            "in Kedro 1.0.0, while adopting the original `DataCatalog` name. Several APIs will be removed "
            "or replaced with updated alternatives in Kedro 1.0.0. "
            "For more details, refer to the documentation: "
            "https://docs.kedro.org/en/stable/data/index.html#kedrodatacatalog-experimental-feature",
            KedroDeprecationWarning,
            stacklevel=2,
        )
```

Code after:
            save_version: Version string to be used for ``save`` operations
                by all datasets with enabled versioning. It must: a) be a
                case-insensitive string that conforms with operating system
                filename limitations, b) always return the latest version when
                sorted in lexicographical order.

        Example:
        ::
            >>> from kedro_datasets.pandas import CSVDataset
            >>>
            >>> cars = CSVDataset(filepath="cars.csv",
            >>>                   load_args=None,
            >>>                   save_args={"index": False})
            >>> catalog = KedroDataCatalog(datasets={"cars": cars})
        """
        warnings.warn(
            "`KedroDataCatalog` is currently an experimental feature and will replace the existing `DataCatalog` "
            "in Kedro 1.0.0, while adopting the original `DataCatalog` name. Several APIs will be removed or "
            "replaced with updated alternatives in Kedro 1.0.0. For more details, refer to the documentation: "
            "https://docs.kedro.org/en/0.19.13/data/index.html#kedrodatacatalog-experimental-feature",
            KedroDeprecationWarning,
            stacklevel=2,
        )
        self._config_resolver = config_resolver or CatalogConfigResolver()
        # TODO: rename back to _datasets when removing old catalog
        self.__datasets: dict[str, AbstractDataset] = datasets or {}
        self._lazy_datasets: dict[str, _LazyDataset] = {}
        self._load_versions, self._save_version = _validate_versions(
            datasets, load_versions or {}, save_version
        )

        self._use_rich_markup = _has_rich_handler()

        for ds_name, ds_config in self._config_resolver.config.items():
            self._add_from_config(ds_name, ds_config)

        raw_data = raw_data or {}
        for ds_name, data in raw_data.items():
            self[ds_name] = data  # type: ignore[has-type]

    @property
    def datasets(self) -> dict[str, Any]:
        # TODO: remove when removing old catalog
        return self._lazy_datasets | self.__datasets

    @datasets.setter
    def datasets(self, value: Any) -> None:
        # TODO: remove when removing old catalog
        raise AttributeError(
            "Operation not allowed. Please use KedroDataCatalog.add() instead."
        )