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

[DataCatalog2.0]: KedroDataCatalog #4151

Merged
merged 176 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
176 commits
Select commit Hold shift + click to select a range
a8f4fb3
Added a skeleton for AbstractDataCatalog and KedroDataCatalog
ElenaKhaustova Jul 31, 2024
7d56818
Removed from_config method
ElenaKhaustova Jul 31, 2024
787e121
Merge branch 'main' into refactor-pattern-logic
ElenaKhaustova Aug 2, 2024
0b80f23
Implemented _init_datasets method
ElenaKhaustova Aug 2, 2024
5c727df
Implemented get dataset
ElenaKhaustova Aug 2, 2024
05c9171
Started resolve_patterns implementation
ElenaKhaustova Aug 2, 2024
5c804d6
Implemented resolve_patterns
ElenaKhaustova Aug 5, 2024
e9ba5c4
Merge branch 'main' into refactor-pattern-logic
ElenaKhaustova Aug 5, 2024
530f7d6
Fixed credentials resolving
ElenaKhaustova Aug 5, 2024
64be83c
Updated match pattern
ElenaKhaustova Aug 6, 2024
c29828a
Implemented add from dict method
ElenaKhaustova Aug 6, 2024
957403a
Updated io __init__
ElenaKhaustova Aug 6, 2024
14908ff
Added list method
ElenaKhaustova Aug 6, 2024
c5e925b
Implemented _validate_missing_keys
ElenaKhaustova Aug 6, 2024
b9a92b0
Added datasets access logic
ElenaKhaustova Aug 7, 2024
2cb794f
Merge branch 'main' into refactor-pattern-logic
ElenaKhaustova Aug 7, 2024
2f32593
Added __contains__ and comments on lazy loading
ElenaKhaustova Aug 7, 2024
d1ea64e
Renamed dataset_name to ds_name
ElenaKhaustova Aug 8, 2024
fb89fca
Updated some docstrings
ElenaKhaustova Aug 8, 2024
4486939
Merge branch 'main' into refactor-pattern-logic
ElenaKhaustova Aug 12, 2024
c667645
Fixed _update_ds_configs
ElenaKhaustova Aug 12, 2024
be8e929
Fixed _init_datasets
ElenaKhaustova Aug 12, 2024
ec7ac39
Implemented add_runtime_patterns
ElenaKhaustova Aug 12, 2024
8e23450
Fixed runtime patterns usage
ElenaKhaustova Aug 13, 2024
529e61a
Merge branch 'main' into refactor-pattern-logic
ElenaKhaustova Aug 19, 2024
e4cb21c
Merge branch 'main' into refactor-pattern-logic
ElenaKhaustova Aug 21, 2024
50bc816
Moved pattern logic out of data catalog, implemented KedroDataCatalog
ElenaKhaustova Aug 21, 2024
6dfbcb0
Merge branch 'main' into 4110-move-pattern-resolution-logic
ElenaKhaustova Aug 22, 2024
9346f08
KedroDataCatalog updates
ElenaKhaustova Aug 22, 2024
9568e29
Added property to return config
ElenaKhaustova Aug 28, 2024
86efdfe
Merge branch 'main' into 4110-move-pattern-resolution-logic
ElenaKhaustova Aug 28, 2024
5e27660
Added list patterns method
ElenaKhaustova Aug 28, 2024
72b11d0
Renamed and moved ConfigResolver
ElenaKhaustova Aug 29, 2024
f0a4090
Renamed ConfigResolver
ElenaKhaustova Aug 29, 2024
a4da52a
Merge branch 'main' into 4110-move-pattern-resolution-logic
ElenaKhaustova Aug 29, 2024
7d6227f
Cleaned KedroDataCatalog
ElenaKhaustova Aug 29, 2024
4092291
Cleaned up DataCatalogConfigResolver
ElenaKhaustova Aug 29, 2024
63e47f9
Docs build fix attempt
ElenaKhaustova Aug 30, 2024
85bf720
KedroDataCatalog draft
ElenaKhaustova Sep 5, 2024
68f6527
Removed KedroDataCatalog
ElenaKhaustova Sep 5, 2024
2ac4a2f
Updated from_config method
ElenaKhaustova Sep 5, 2024
cb5879d
Updated constructor and add methods
ElenaKhaustova Sep 5, 2024
9038e96
Updated _get_dataset method
ElenaKhaustova Sep 5, 2024
cc89565
Updated __contains__
ElenaKhaustova Sep 5, 2024
59b6764
Updated __eq__ and shallow_copy
ElenaKhaustova Sep 5, 2024
4f5a3fb
Added __iter__ and __getitem__
ElenaKhaustova Sep 5, 2024
12ed6f2
Removed unused imports
ElenaKhaustova Sep 5, 2024
a106cec
Added TODO
ElenaKhaustova Sep 5, 2024
6df04f7
Updated runner.run()
ElenaKhaustova Sep 5, 2024
8566e27
Updated session
ElenaKhaustova Sep 5, 2024
2dcea33
Added confil_resolver property
ElenaKhaustova Sep 5, 2024
a46597f
Updated catalog list command
ElenaKhaustova Sep 5, 2024
3787545
Updated catalog create command
ElenaKhaustova Sep 5, 2024
68d612d
Updated catalog rank command
ElenaKhaustova Sep 5, 2024
af5bee9
Updated catalog resolve command
ElenaKhaustova Sep 5, 2024
acc4d6e
Merge branch 'main' into 4110-move-pattern-resolution-logic
ElenaKhaustova Sep 5, 2024
e67ff0f
Remove some methods
ElenaKhaustova Sep 5, 2024
7b3afa2
Removed ds configs from catalog
ElenaKhaustova Sep 6, 2024
658a759
Fixed lint
ElenaKhaustova Sep 6, 2024
7be2a8e
Fixed typo
ElenaKhaustova Sep 6, 2024
09f3f26
Merge branch 'main' into 4110-move-pattern-resolution-logic
ElenaKhaustova Sep 6, 2024
9e43a9a
Added module docstring
ElenaKhaustova Sep 6, 2024
b28a9bf
Merge branch 'main' into 3995-data-catalog-2.0
ElenaKhaustova Sep 6, 2024
c9f3469
Merge branch '4110-move-pattern-resolution-logic' into 3995-data-cata…
ElenaKhaustova Sep 6, 2024
49a3b27
Renaming methods
ElenaKhaustova Sep 6, 2024
25b6501
Removed None from Pattern type
ElenaKhaustova Sep 6, 2024
3a646de
Fixed docs failing to find class reference
ElenaKhaustova Sep 6, 2024
5e5df4a
Fixed docs failing to find class reference
ElenaKhaustova Sep 6, 2024
aa59a35
Updated Patterns type
ElenaKhaustova Sep 6, 2024
c7efa3e
Fix tests (#4149)
ankatiyar Sep 6, 2024
023ffc6
Returned constants to avoid breaking changes
ElenaKhaustova Sep 6, 2024
6971779
Merge branch '4110-move-pattern-resolution-logic' into 3995-data-cata…
ElenaKhaustova Sep 6, 2024
d57a567
Udapted KedroDataCatalog for recent changes
ElenaKhaustova Sep 6, 2024
585b44f
Minor fix
ElenaKhaustova Sep 6, 2024
2769def
Merge branch '4110-move-pattern-resolution-logic' into 3995-data-cata…
ElenaKhaustova Sep 6, 2024
e447078
Updated test_sorting_order_with_other_dataset_through_extra_pattern
ElenaKhaustova Sep 9, 2024
beb0165
Merge branch 'main' into 4110-move-pattern-resolution-logic
ElenaKhaustova Sep 9, 2024
975e968
Removed odd properties
ElenaKhaustova Sep 9, 2024
11d782c
Updated tests
ElenaKhaustova Sep 9, 2024
e4abd23
Removed None from _fetch_credentials input
ElenaKhaustova Sep 9, 2024
5f105de
Merge branch '4110-move-pattern-resolution-logic' into 3995-data-cata…
ElenaKhaustova Sep 9, 2024
f9cb9c6
Updated specs and context
ElenaKhaustova Sep 9, 2024
31a9484
Updated runners
ElenaKhaustova Sep 9, 2024
ced1b7a
Updated default catalog validation
ElenaKhaustova Sep 9, 2024
7f9b576
Updated default catalog validation
ElenaKhaustova Sep 9, 2024
a3828d9
Updated contains and added exists methods for KedroDataCatalog
ElenaKhaustova Sep 9, 2024
16610c4
Fixed docs
ElenaKhaustova Sep 9, 2024
321affe
Fixing docs and lint
ElenaKhaustova Sep 9, 2024
ff25405
Fixed docs
ElenaKhaustova Sep 9, 2024
d0000c0
Fixed docs
ElenaKhaustova Sep 9, 2024
7f5ddec
Fixed unit tests
ElenaKhaustova Sep 10, 2024
e030bb6
Added __eq__
ElenaKhaustova Sep 10, 2024
6433dd8
Renamed DataCatalogConfigResolver to CatalogConfigResolver
ElenaKhaustova Sep 10, 2024
355576f
Renamed _init_configs to _resolve_config_credentials
ElenaKhaustova Sep 10, 2024
39d9ff6
Moved functions to the class
ElenaKhaustova Sep 10, 2024
659c9da
Refactored resolve_dataset_pattern
ElenaKhaustova Sep 10, 2024
840b32a
Fixed refactored part
ElenaKhaustova Sep 10, 2024
77f551c
Changed the order of arguments for DataCatalog constructor
ElenaKhaustova Sep 10, 2024
6e079a1
Replaced __getitem__ with .get()
ElenaKhaustova Sep 10, 2024
1f7e5f8
Updated catalog commands
ElenaKhaustova Sep 10, 2024
80f0e3d
Moved warm up block outside of the try block
ElenaKhaustova Sep 10, 2024
017cda3
Fixed linter
ElenaKhaustova Sep 10, 2024
cab6f06
Removed odd copying
ElenaKhaustova Sep 10, 2024
ac1ecc0
Merge branch '4110-move-pattern-resolution-logic' into 3995-data-cata…
ElenaKhaustova Sep 10, 2024
e955930
Renamed DataCatalogConfigResolver to CatalogConfigResolver
ElenaKhaustova Sep 10, 2024
a07f3d4
Renamed AbstractDataCatalog to BaseDataCatalog
ElenaKhaustova Sep 10, 2024
4ecb826
Moved validate_dataset_config inside catalog
ElenaKhaustova Sep 10, 2024
2b9be66
Renamed _init_dataset to _add_from_config
ElenaKhaustova Sep 10, 2024
fb3831b
Fix lint
ElenaKhaustova Sep 10, 2024
8f604d1
Updated release notes
ElenaKhaustova Sep 11, 2024
9a4db18
Returned DatasetError
ElenaKhaustova Sep 11, 2024
0a6946a
Added _dataset_patterns and _default_pattern to _config_resolver to a…
ElenaKhaustova Sep 11, 2024
fee7bd6
Made resolve_dataset_pattern return just dict
ElenaKhaustova Sep 11, 2024
f5a7992
Fixed linter
ElenaKhaustova Sep 11, 2024
1c981f3
Added Catalogprotocol draft
ElenaKhaustova Sep 11, 2024
6128be7
Implemented CatalogProtocol
ElenaKhaustova Sep 12, 2024
8c91d0e
Updated types
ElenaKhaustova Sep 12, 2024
18d2ba0
Fixed linter
ElenaKhaustova Sep 12, 2024
d48c6d3
Added _ImplementsCatalogProtocolValidator
ElenaKhaustova Sep 12, 2024
45ce6bc
Updated docstrings
ElenaKhaustova Sep 12, 2024
6ca972f
Fixed tests
ElenaKhaustova Sep 12, 2024
fdce5ea
Fixed docs
ElenaKhaustova Sep 12, 2024
3029963
Excluded Potocol from coverage
ElenaKhaustova Sep 12, 2024
0150a21
Merge branch 'main' into 4138-catalog-protocol
ElenaKhaustova Sep 12, 2024
0833a84
Fixed docs
ElenaKhaustova Sep 12, 2024
95ccb3c
Merge branch 'main' into 3995-data-catalog-2.0
ElenaKhaustova Sep 13, 2024
07908a8
Renamed catalog source to kedro_data_catalog
ElenaKhaustova Sep 13, 2024
25a6fcf
Renamed data set to dataset in docstrings
ElenaKhaustova Sep 13, 2024
07f8c12
Updated add_from_dict
ElenaKhaustova Sep 13, 2024
3a1a0f2
Revised comments and TODOs
ElenaKhaustova Sep 13, 2024
cf663a0
Updated error message to point to specific catalog type
ElenaKhaustova Sep 13, 2024
caa7316
Fixed tests
ElenaKhaustova Sep 13, 2024
9540a32
Merge branch '4138-catalog-protocol' into 3995-data-catalog-2.0
ElenaKhaustova Sep 13, 2024
0ac154d
Merged with protocol
ElenaKhaustova Sep 13, 2024
0ec1f23
Removed reference to DataCatalog in docstrings
ElenaKhaustova Sep 13, 2024
96d4576
Merge branch '4138-catalog-protocol' into 3995-data-catalog-2.0
ElenaKhaustova Sep 13, 2024
4ecd8fd
Fixed docs
ElenaKhaustova Sep 13, 2024
11b3426
Reordered methods
ElenaKhaustova Sep 13, 2024
741b682
Removed add_all from protocol
ElenaKhaustova Sep 13, 2024
88ba38b
Merge branch '4138-catalog-protocol' into 3995-data-catalog-2.0
ElenaKhaustova Sep 13, 2024
0020095
Changed the order of arguments
ElenaKhaustova Sep 13, 2024
78feb51
Updated docstrings
ElenaKhaustova Sep 13, 2024
6bf912c
Updated docstrings
ElenaKhaustova Sep 13, 2024
c7699ec
Merge branch '4138-catalog-protocol' into 3995-data-catalog-2.0
ElenaKhaustova Sep 13, 2024
bcd2d37
Added __repr__
ElenaKhaustova Sep 16, 2024
eb7e8f5
Made __getitem__ return deepcopy
ElenaKhaustova Sep 16, 2024
7348c12
Fixed bug in get_dataset()
ElenaKhaustova Sep 16, 2024
5aee9e9
Fixed __eq__
ElenaKhaustova Sep 16, 2024
c9c7c9a
Fixed docstrings
ElenaKhaustova Sep 16, 2024
c66df33
Merge branch 'main' into 4138-catalog-protocol
ElenaKhaustova Sep 16, 2024
2f1dcbd
Merge branch '4138-catalog-protocol' into 3995-data-catalog-2.0
ElenaKhaustova Sep 16, 2024
4b8d90c
Added __setitem__
ElenaKhaustova Sep 17, 2024
8f870a8
Unit tests for `KedroDataCatalog` (#4171)
ElenaKhaustova Sep 17, 2024
70dc177
Merge branch 'main' into 3995-data-catalog-2.0
ElenaKhaustova Sep 17, 2024
ae7a271
Updated RELEASE.md
ElenaKhaustova Sep 17, 2024
135cb0e
Removed deep copies
ElenaKhaustova Sep 18, 2024
ca4867c
Removed some interface that will be changed in the next version
ElenaKhaustova Sep 18, 2024
4745f71
Removed key completions
ElenaKhaustova Sep 18, 2024
033a0b7
Fixinf typos
ElenaKhaustova Sep 18, 2024
e74ffda
Removed key completions test
ElenaKhaustova Sep 18, 2024
00af3ec
Replaced data set with dataset
ElenaKhaustova Sep 18, 2024
2de7ccb
Added docstring for get_dataset() method
ElenaKhaustova Sep 18, 2024
8affed6
Renamed pytest fixture
ElenaKhaustova Sep 18, 2024
a52672e
Addressed review comments
ElenaKhaustova Sep 19, 2024
84f249c
Updated _assert_requirements_ok starters test
ElenaKhaustova Sep 20, 2024
2548119
Revert "Updated _assert_requirements_ok starters test"
ElenaKhaustova Sep 20, 2024
ac124e3
Updated error message
ElenaKhaustova Sep 20, 2024
f62ed03
Replaced typo
ElenaKhaustova Sep 20, 2024
b65609f
Replaced data set with dataset in docstrings
ElenaKhaustova Sep 20, 2024
17199ad
Updated tests
ElenaKhaustova Sep 20, 2024
44c576e
Merge branch 'main' into 3995-data-catalog-2.0
ElenaKhaustova Sep 20, 2024
6d5f094
Made KedroDataCatalog subclass from CatalogProtocol
ElenaKhaustova Sep 23, 2024
e24b2a6
Updated release notes
ElenaKhaustova Sep 23, 2024
c8ef90f
Merge branch 'main' into 3995-data-catalog-2.0
ElenaKhaustova Sep 23, 2024
d19941f
Renamed resolve_dataset_pattern to resolve_pattern
ElenaKhaustova Sep 24, 2024
572594e
Merge branch 'main' into 3995-data-catalog-2.0
ElenaKhaustova Sep 24, 2024
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
5 changes: 5 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Upcoming Release

## Major features and improvements
* Implemented `KedroDataCatalog` repeating `DataCatalog` functionality with a few API enhancements:

Check warning on line 4 in RELEASE.md

View workflow job for this annotation

GitHub Actions / vale

[vale] RELEASE.md#L4

[Kedro.weaselwords] 'few' is a weasel word!
Raw output
{"message": "[Kedro.weaselwords] 'few' is a weasel word!", "location": {"path": "RELEASE.md", "range": {"start": {"line": 4, "column": 79}}}, "severity": "WARNING"}
* Removed `_FrozenDatasets` and access datasets as properties;
* Added get dataset by name feature;
* `add_feed_dict()` was simplified and renamed to `add_data()`;
* Datasets' initialisation was moved out from `from_config()` method to the constructor.
* Moved development requirements from `requirements.txt` to the dedicated section in `pyproject.toml` for project template.
* Implemented `Protocol` abstraction for the current `DataCatalog` and adding new catalog implementations.
* Refactored `kedro run` and `kedro catalog` commands.
Expand Down
2 changes: 2 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
"kedro.io.core.DatasetError",
"kedro.io.core.Version",
"kedro.io.data_catalog.DataCatalog",
"kedro.io.kedro_data_catalog.KedroDataCatalog",
idanov marked this conversation as resolved.
Show resolved Hide resolved
"kedro.io.memory_dataset.MemoryDataset",
"kedro.io.partitioned_dataset.PartitionedDataset",
"kedro.pipeline.pipeline.Pipeline",
Expand Down Expand Up @@ -172,6 +173,7 @@
"Patterns",
"CatalogConfigResolver",
"CatalogProtocol",
"KedroDataCatalog",
),
"py:data": (
"typing.Any",
Expand Down
6 changes: 2 additions & 4 deletions kedro/framework/cli/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ def list_datasets(metadata: ProjectMetadata, pipeline: str, env: str) -> None:

for ds_name in default_ds:
if data_catalog.config_resolver.match_pattern(ds_name):
ds_config = data_catalog.config_resolver.resolve_dataset_pattern(
ds_name
)
ds_config = data_catalog.config_resolver.resolve_pattern(ds_name)
factory_ds_by_type[ds_config.get("type", "DefaultDataset")].append(
ds_name
)
Expand Down Expand Up @@ -250,7 +248,7 @@ def resolve_patterns(metadata: ProjectMetadata, env: str) -> None:
if ds_name in explicit_datasets or is_parameter(ds_name):
continue

ds_config = data_catalog.config_resolver.resolve_dataset_pattern(ds_name)
ds_config = data_catalog.config_resolver.resolve_pattern(ds_name)

# Exclude MemoryDatasets not set in the catalog explicitly
if ds_config:
Expand Down
2 changes: 2 additions & 0 deletions kedro/io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
Version,
)
from .data_catalog import DataCatalog
from .kedro_data_catalog import KedroDataCatalog
from .lambda_dataset import LambdaDataset
from .memory_dataset import MemoryDataset
from .shared_memory_dataset import SharedMemoryDataset
Expand All @@ -30,6 +31,7 @@
"DatasetAlreadyExistsError",
"DatasetError",
"DatasetNotFoundError",
"KedroDataCatalog",
"LambdaDataset",
"MemoryDataset",
"SharedMemoryDataset",
Expand Down
2 changes: 1 addition & 1 deletion kedro/io/catalog_config_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def _resolve_config_credentials(

return resolved_configs

def resolve_dataset_pattern(self, ds_name: str) -> dict[str, Any]:
def resolve_pattern(self, ds_name: str) -> dict[str, Any]:
"""Resolve dataset patterns and return resolved configurations based on the existing patterns."""
matched_pattern = self.match_pattern(ds_name)

Expand Down
4 changes: 2 additions & 2 deletions kedro/io/data_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def __setattr__(self, key: str, value: Any) -> None:
if key == "_original_names":
super().__setattr__(key, value)
return
msg = "Operation not allowed! "
msg = "Operation not allowed. "
if key in self.__dict__:
msg += "Please change datasets through configuration."
else:
Expand Down Expand Up @@ -324,7 +324,7 @@ def _get_dataset(
version: Version | None = None,
suggest: bool = True,
) -> AbstractDataset:
ds_config = self._config_resolver.resolve_dataset_pattern(dataset_name)
ds_config = self._config_resolver.resolve_pattern(dataset_name)

if dataset_name not in self._datasets and ds_config:
ds = AbstractDataset.from_config(
Expand Down
Loading