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

Proposal: modify catalog validation to allow variable interpolation #2516

Closed
wants to merge 1 commit into from
Closed
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
3 changes: 0 additions & 3 deletions kedro/io/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,6 @@ def parse_dataset_definition(
save_version = save_version or generate_timestamp()
config = copy.deepcopy(config)

if "type" not in config:
raise DataSetError("'type' is missing from DataSet catalog configuration")

class_obj = config.pop("type")
if isinstance(class_obj, str):
if len(class_obj.strip(".")) != len(class_obj):
Expand Down
17 changes: 9 additions & 8 deletions kedro/io/data_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,15 @@ class to be loaded is specified with the key ``type`` and their

layers = defaultdict(set) # type: Dict[str, Set[str]]
for ds_name, ds_config in catalog.items():
ds_layer = ds_config.pop("layer", None)
if ds_layer is not None:
layers[ds_layer].add(ds_name)

ds_config = _resolve_credentials(ds_config, credentials)
data_sets[ds_name] = AbstractDataSet.from_config(
ds_name, ds_config, load_versions.get(ds_name), save_version
)
if "type" in ds_config:
ds_layer = ds_config.pop("layer", None)
if ds_layer is not None:
layers[ds_layer].add(ds_name)

ds_config = _resolve_credentials(ds_config, credentials)
data_sets[ds_name] = AbstractDataSet.from_config(
ds_name, ds_config, load_versions.get(ds_name), save_version
)

dataset_layers = layers or None
return cls(data_sets=data_sets, layers=dataset_layers)
Expand Down
3 changes: 2 additions & 1 deletion kedro/runner/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def run(
unsatisfied = pipeline.inputs() - set(catalog.list())
if unsatisfied:
raise ValueError(
f"Pipeline input(s) {unsatisfied} not found in the DataCatalog"
f"Pipeline input(s) {unsatisfied} not found in the DataCatalog. "
f"Make sure that any dataset entry contains the 'type' key."
)

free_outputs = pipeline.outputs() - set(catalog.list())
Expand Down