Skip to content

Commit

Permalink
Materialized cached_ds
Browse files Browse the repository at this point in the history
Signed-off-by: Elena Khaustova <[email protected]>
  • Loading branch information
ElenaKhaustova committed Nov 14, 2024
1 parent 8795dd6 commit e3289b4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion kedro/io/kedro_data_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def to_config(
)
catalog[ds_name] = unresolved_config
credentials.update(unresolved_credentials)
# TODO: Update when resolve #4327
# TODO: Update when #4327 resolved
if catalog[ds_name].get(VERSIONED_FLAG_KEY, None):
load_version[ds_name] = ds.load_version
save_version[ds_name] = ds.save_version
Expand Down
5 changes: 3 additions & 2 deletions tests/io/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,14 @@ def correct_config_versioned(filepath):
"save_args": {"sep": ",", "nullstr": "#NA"},
},
"cached_ds": {
"type": "CachedDataset",
"versioned": "true",
"type": "kedro.io.cached_dataset.CachedDataset",
"versioned": True,
"dataset": {
"type": "pandas.CSVDataset",
"filepath": "cached_ds.csv",
"credentials": "cached_ds_credentials",
},
"copy_mode": None,
},
},
"credentials": {
Expand Down
4 changes: 4 additions & 0 deletions tests/io/test_kedro_data_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,8 @@ def test_to_config(self, correct_config_versioned, dataset, filepath):
catalog = KedroDataCatalog.from_config(config, credentials)
catalog["resolved_ds"] = dataset
catalog["memory_ds"] = [1, 2, 3]
# Materialize cached_ds
_ = catalog["cached_ds"]

version = Version(
load="fake_load_version.csv", # load exact version
Expand Down Expand Up @@ -347,6 +349,8 @@ def test_to_config(self, correct_config_versioned, dataset, filepath):
}
expected_config.update(config)

# TODO: Add expected load/save versions when #4327 resolved

assert catalog_config == expected_config
assert catalog_credentials == credentials

Expand Down

0 comments on commit e3289b4

Please sign in to comment.