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

Code before:

    Raises:
        DatasetError: If the function fails to parse the configuration provided.

    Returns:
        2-tuple: (Dataset class object, configuration dictionary)
    """
    save_version = save_version or generate_timestamp()
    config = copy.deepcopy(config)

    # TODO: remove when removing old catalog as moved to KedroDataCatalog
    if TYPE_KEY not in config:
        raise DatasetError(
            "'type' is missing from dataset catalog configuration."
            "\nHint: If this catalog entry is intended for variable interpolation, "
            "make sure that the top level key is preceded by an underscore."
        )

    dataset_type = config.pop(TYPE_KEY)

    # This check prevents the use of dataset types with uppercase 'S' in 'Dataset',
    # which is no longer supported as of Kedro 0.19.
    if isinstance(dataset_type, str):
        if dataset_type.endswith("Set"):
            raise ValueError(
                f"Since Kedro 0.19, 'Dataset' is spelled with a lowercase 's'. Got '{dataset_type}'."
            )

    class_obj = None
    if isinstance(dataset_type, str):
        if len(dataset_type.strip(".")) != len(dataset_type):
            raise DatasetError(
                "'type' class path does not support relative "
                "paths or paths ending with a dot."
            )
        class_paths = (prefix + dataset_type for prefix in _DEFAULT_PACKAGES)

        for class_path in class_paths:
            tmp = _load_obj(class_path)
            if tmp is not None:
                class_obj = tmp
                break
        else:
            hint = (
                "Hint: If you are trying to use a dataset from `kedro-datasets`, "
                "make sure that the package is installed in your current environment. "
                "You can do so by running `pip install kedro-datasets` or "
                "`pip install kedro-datasets[<dataset-group>]` to install `kedro-datasets` along with "
                "related dependencies for the specific dataset group."
            )
            raise DatasetError(

Review comment (suggestion):
Maybe it should be `kedro-datasets 2.0` instead of Kedro 0.19? It was technically removed it `kedro-datasets` but we have `MemoryDataset` etc in Kedro.

Code after:

    Raises:
        DatasetError: If the function fails to parse the configuration provided.

    Returns:
        2-tuple: (Dataset class object, configuration dictionary)
    """
    save_version = save_version or generate_timestamp()
    config = copy.deepcopy(config)

    # TODO: remove when removing old catalog as moved to KedroDataCatalog
    if TYPE_KEY not in config:
        raise DatasetError(
            "'type' is missing from dataset catalog configuration."
            "\nHint: If this catalog entry is intended for variable interpolation, "
            "make sure that the top level key is preceded by an underscore."
        )

    dataset_type = config.pop(TYPE_KEY)

    # This check prevents the use of dataset types with uppercase 'S' in 'Dataset',
    # which is no longer supported as of kedro-datasets 2.0
    if isinstance(dataset_type, str):
        if dataset_type.endswith("Set"):
            warnings.warn(
                f"Since kedro-datasets 2.0, 'Dataset' is spelled with a lowercase 's'. Got '{dataset_type}'.",
                UserWarning,
            )

    class_obj = None
    if isinstance(dataset_type, str):
        if len(dataset_type.strip(".")) != len(dataset_type):
            raise DatasetError(
                "'type' class path does not support relative "
                "paths or paths ending with a dot."
            )
        class_paths = (prefix + dataset_type for prefix in _DEFAULT_PACKAGES)

        for class_path in class_paths:
            tmp = _load_obj(class_path)
            if tmp is not None:
                class_obj = tmp
                break
        else:
            hint = (
                "Hint: If you are trying to use a dataset from `kedro-datasets`, "
                "make sure that the package is installed in your current environment. "
                "You can do so by running `pip install kedro-datasets` or "
                "`pip install kedro-datasets[<dataset-group>]` to install `kedro-datasets` along with "
                "related dependencies for the specific dataset group."
            )