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

Code before:
        Raises:
            DatasetAlreadyExistsError: When a data set with the same name
                has already been registered.

        Example:
        ::

            >>> from kedro_datasets.pandas import CSVDataset, ParquetDataset
            >>>
            >>> io = DataCatalog(datasets={
            >>>                   "cars": CSVDataset(filepath="cars.csv")
            >>>                  })
            >>> additional = {
            >>>     "planes": ParquetDataset("planes.parq"),
            >>>     "boats": CSVDataset(filepath="boats.csv")
            >>> }
            >>>
            >>> io.add_all(additional)
            >>>
            >>> assert io.list() == ["cars", "planes", "boats"]
        """
        for name, dataset in datasets.items():
            self.add(name, dataset, replace)

    def add_feed_dict(self, feed_dict: dict[str, Any], replace: bool = False) -> None:
        """This function adds datasets to the ``DataCatalog`` using the data provided through the `feed_dict`.

        `feed_dict` dictionary key is used as a dataset name, and a value is used to create an instance of
        ``MemoryDataset`` before adding to the ``DataCatalog`` for all the value types except of ``AbstractDataset``.
        In the last case, the ``AbstractDataset`` is added as it is.

        Has `from_dict` alias, so it can be called using `from_dict` name instead.
        Will be fully renamed to `from_dict` in the `0.20.0` version.

        Args:
            feed_dict: A feed dict with data to be added to the ``DataCatalog``.
            replace: Specifies whether to replace an existing dataset with the same name in the ``DataCatalog``.

        Example:
        ::

            >>> from kedro_datasets.pandas import CSVDataset
            >>> import pandas as pd
            >>>
            >>> df = pd.DataFrame({"col1": [1, 2],
            >>>                    "col2": [4, 5],
            >>>                    "col3": [5, 6]})
            >>>
            >>> catalog = DataCatalog()
            >>> catalog.add_feed_dict({
            >>>     "data_df": df

Review comment (suggestion):
I'm still missing a bit more explanation here about what `feed_dict` is. Adding that would make a huge difference to me.

Code after:
        Raises:
            DatasetAlreadyExistsError: When a data set with the same name
                has already been registered.

        Example:
        ::

            >>> from kedro_datasets.pandas import CSVDataset, ParquetDataset
            >>>
            >>> io = DataCatalog(datasets={
            >>>                   "cars": CSVDataset(filepath="cars.csv")
            >>>                  })
            >>> additional = {
            >>>     "planes": ParquetDataset("planes.parq"),
            >>>     "boats": CSVDataset(filepath="boats.csv")
            >>> }
            >>>
            >>> io.add_all(additional)
            >>>
            >>> assert io.list() == ["cars", "planes", "boats"]
        """
        for name, dataset in datasets.items():
            self.add(name, dataset, replace)

    def add_feed_dict(self, feed_dict: dict[str, Any], replace: bool = False) -> None:
        """Add datasets to the ``DataCatalog`` using the data provided through the `feed_dict`.

        `feed_dict` is a dictionary where the keys represent dataset names and the values can either be raw data or
        Kedro datasets - instances of classes that inherit from ``AbstractDataset``. If raw data is provided,
        it will be automatically wrapped in a ``MemoryDataset`` before being added to the ``DataCatalog``.

        Args:
            feed_dict: A dictionary with data to be added to the ``DataCatalog``. Keys are dataset names and
                values can be raw data or instances of classes that inherit from ``AbstractDataset``.
            replace: Specifies whether to replace an existing dataset with the same name in the ``DataCatalog``.

        Example:
        ::

            >>> from kedro_datasets.pandas import CSVDataset
            >>> import pandas as pd
            >>>
            >>> df = pd.DataFrame({"col1": [1, 2],
            >>>                    "col2": [4, 5],
            >>>                    "col3": [5, 6]})
            >>>
            >>> catalog = DataCatalog()
            >>> catalog.add_feed_dict({
            >>>     "data_df": df
            >>> }, replace=True)
            >>>