diff --git a/RELEASE.md b/RELEASE.md index a80940b776..8361d7e7d6 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -43,6 +43,8 @@ | `AbstractDataset` | `AbstractDataSet` | `kedro.io.core` | | `AbstractVersionedDataset` | `AbstractVersionedDataSet` | `kedro.io.core` | +* Using the `layer` attribute at the top level is deprecated; it will be removed in Kedro version 0.19.0. Please move `layer` inside the `metadata` -> `kedro-viz` attributes. + # Release 0.18.12 ## Major features and improvements diff --git a/kedro/io/data_catalog.py b/kedro/io/data_catalog.py index 156be2130f..4cbe6c0142 100644 --- a/kedro/io/data_catalog.py +++ b/kedro/io/data_catalog.py @@ -293,6 +293,17 @@ class to be loaded is specified with the key ``type`` and their dataset_patterns[ds_name] = ds_config else: + # Check if 'layer' attribute is defined at the top level + if "layer" in ds_config: + import warnings + + warnings.warn( + "Defining the 'layer' attribute at the top level is deprecated " + "and will be removed in Kedro 0.19.0. Please move 'layer' inside the 'metadata' -> " + "'kedro-viz' attributes. See https://docs.kedro.org/en/latest/visualisation/kedro" + "-viz_visualisation.html#visualise-layers for more information.", + FutureWarning, + ) ds_layer = ds_config.pop("layer", None) if ds_layer is not None: layers[ds_layer].add(ds_name)