Skip to content

Commit

Permalink
Make all paths relative in kedro catalog resolve (#3641)
Browse files Browse the repository at this point in the history
* Make all paths relative in kedro catalog resolve

Signed-off-by: Ankita Katiyar <ankitakatiyar2401@gmail.com>

* Refactor existing tests

Signed-off-by: Ankita Katiyar <ankitakatiyar2401@gmail.com>

* Add partitioneddataset to test + refactor

Signed-off-by: Ankita Katiyar <ankitakatiyar2401@gmail.com>

* Change to DataCatalog

Signed-off-by: Ankita Katiyar <ankitakatiyar2401@gmail.com>

---------

Signed-off-by: Ankita Katiyar <ankitakatiyar2401@gmail.com>
Co-authored-by: Ahdra Merali <90615669+AhdraMeraliQB@users.noreply.github.com>
  • Loading branch information
ankatiyar and AhdraMeraliQB authored Feb 26, 2024
1 parent ffc2683 commit 7a0d7d0
Show file tree
Hide file tree
Showing 2 changed files with 215 additions and 173 deletions.
4 changes: 2 additions & 2 deletions kedro/framework/cli/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from kedro.framework.session import KedroSession
from kedro.framework.startup import ProjectMetadata
from kedro.io import AbstractDataset
from kedro.io.data_catalog import DataCatalog


def _create_session(package_name: str, **kwargs: Any) -> KedroSession:
Expand Down Expand Up @@ -231,8 +232,8 @@ def resolve_patterns(metadata: ProjectMetadata, env: str) -> None:
session = _create_session(metadata.package_name, env=env)
context = session.load_context()

data_catalog = context.catalog
catalog_config = context.config_loader["catalog"]
data_catalog = DataCatalog.from_config(catalog_config)

explicit_datasets = {
ds_name: ds_config
Expand Down Expand Up @@ -264,7 +265,6 @@ def resolve_patterns(metadata: ProjectMetadata, env: str) -> None:
ds_config = data_catalog._resolve_config(
ds_name, matched_pattern, ds_config_copy
)

explicit_datasets[ds_name] = ds_config

secho(yaml.dump(explicit_datasets))
Loading

0 comments on commit 7a0d7d0

Please sign in to comment.