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

Change how kedro import datasets and raise explicit error when dependencies is missing #3272

Merged
merged 20 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Change error message
Signed-off-by: Nok Chan <nok.lam.chan@quantumblack.com>
  • Loading branch information
noklam committed Nov 8, 2023
commit 2450178cd029e1f4e5e4504ecdd6bd98a1eb268f
3 changes: 1 addition & 2 deletions kedro/io/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,7 @@ def parse_dataset_definition(
break
else:
raise DatasetError(
f"Class '{dataset_type}' not found or one of its dependencies "
f"has not been installed."
f"Class '{dataset_type}' not found, is this a typo?"
)

if not issubclass(class_obj, AbstractDataset):
Expand Down
2 changes: 1 addition & 1 deletion tests/io/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def test_dataset_name_typo(self, mocker):
mocker.patch("kedro.io.core.load_obj", return_value=None)
dataset_name = "lAmbDaDaTAsET"

with pytest.raises(DatasetError, match=f"Class '{dataset_name}' not found"):
with pytest.raises(DatasetError, match=f"Class '{dataset_name}' not found, is this a typo?"):
parse_dataset_definition({"type": dataset_name})

def test_missing_dependencies(self, mocker):
Expand Down