Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DataCatalog deprecation warning #4510

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Added `Pipeline.grouped_nodes_by_namespace` property which returns a dictionary of nodes grouped by namespace, intended to be used by plugins to facilitate deployment of namespaced nodes together.

## Bug fixes and other changes
* Added `DataCatalog` deprecation warning.
* Updated `_LazyDataset` representation when printing `KedroDataCatalog`.
* Fixed `MemoryDataset` to infer `assign` copy mode for Ibis Tables, which previously would be inferred as `deepcopy`.
## Breaking changes to the API
Expand Down
8 changes: 8 additions & 0 deletions kedro/io/data_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
import logging
import pprint
import re
import warnings
from typing import Any

from kedro import KedroDeprecationWarning
from kedro.io.catalog_config_resolver import (
CREDENTIALS_KEY, # noqa: F401
CatalogConfigResolver,
Expand Down Expand Up @@ -160,6 +162,12 @@ def __init__( # noqa: PLR0913
>>> save_args={"index": False})
>>> catalog = DataCatalog(datasets={'cars': cars})
"""
warnings.warn(
"`DataCatalog` has been deprecated and will be replaced by an improved alternative, `KedroDataCatalog`, in Kedro 1.0.0."
"After this change, the `DataCatalog` name will persist, but its functionality will align with `KedroDataCatalog`. "
"For more details, refer to the documentation: https://docs.kedro.org/en/stable/data/index.html#kedrodatacatalog-experimental-feature",
Comment on lines +166 to +168
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"`DataCatalog` has been deprecated and will be replaced by an improved alternative, `KedroDataCatalog`, in Kedro 1.0.0."
"After this change, the `DataCatalog` name will persist, but its functionality will align with `KedroDataCatalog`. "
"For more details, refer to the documentation: https://docs.kedro.org/en/stable/data/index.html#kedrodatacatalog-experimental-feature",
"`DataCatalog` has been deprecated and will be replaced by `KedroDataCatalog` in Kedro 1.0.0."
"After this change, the `DataCatalog` name will persist, but its functionality will align with `KedroDataCatalog`. "
"For more details, refer to the documentation: https://docs.kedro.org/en/stable/data/index.html#kedrodatacatalog-experimental-feature",

While I agree it's an improvement it's up to the user to decide if it is 😉 this way the message is shorter as well.

KedroDeprecationWarning,
)
self._config_resolver = config_resolver or CatalogConfigResolver()
# Kept to avoid breaking changes
if not config_resolver:
Expand Down