Skip to content

Hint how to fix cannot import name 'SomeDataSet' in Kedro >= 0.19 #4595

@yury-fedotov

Description

@yury-fedotov

Context

In both my company's internal slack and the Kedro slack, I'm frequently seeing a question like:

Getting an error like this, anyone encountered before?
ImportError: cannot import name 'ExcelDataSet' from 'kedro_datasets.pandas'

Which is resolved by changing ExcelDataSet to ExcelDataset.

Feature

I'm wondering if Kedro could provide a custom error message with a hint that since 0.19, Dataset is spelled with lowecase s?

Possible implementation

When dataset definitions from Kedro catalog get parsed to paths of Python objects, do something like:

for dataset in catalog:
    if dataset.type.endswith("Set") and dataset.type.startswith("kedro_datasets")
        raise ValueError(
            "Since Kedro 0.19, Dataset is spelled with lowercase 's'. Got {dataset.type}"
        )

Metadata

Metadata

Assignees

No one assigned

    Labels

    CommunityIssue/PR opened by the open-source communityIssue: Feature RequestNew feature or improvement to existing feature

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions