Kedro: [KED-1634] Improve DataSetNotFoundError: messages for typos (did you mean)

Created on 22 Apr 2020  路  5Comments  路  Source: quantumblacklabs/kedro

Description

I'm always frustrated when I get a DataSetNotFoundError: for typos. Would it be possible to look at the catalog for similarly named entries and suggest them similar to click-didyoumean

Context

Mostly when ad-hoc loading dataset its sometimes hard to remember long dataset names. It would be helpful if kedro could suggest the correct spelling if I miss it by a few characters.

Possible Implementation

(Optional) Suggest an idea for implementing the addition or change.

 ---------------------------------------------------------------------------
DataSetNotFoundError                      Traceback (most recent call last)
<ipython-input-22-0b55c03ca6c5> in <module>
 ----> 1 catalog.load("raw_C")
/path/to/data_catalog.py in load(self, name, version)
    347         if name not in self._data_sets:
    348             raise DataSetNotFoundError(
--> 349                 "DataSet '{}' not found in the catalog".format(name)
    350             )
    351
- DataSetNotFoundError: DataSet 'raw_C' not found in the catalog
+ DataSetNotFoundError: DataSet 'raw_C' not found in the catalog
+    did you mean 'raw_c'?

Possible Alternatives

Let me know if this should be combined with #336

Feature Request

All 5 comments

This seems like a good idea.
Can be implemented with simple Jaccard similarity between the name and self._data_sets.keys(). To prevent irrelevant recommendations, have a threshold on the similarity metric.

Thanks for suggesting this @WaylonWalker! I've added it to our backlog so we can look into this.

Hi @WaylonWalker , thank you for the suggestion! It has been addressed in this commit, closing this issue as resolved.

Awesome. Thanks @lorenabalan !

鉂わ笍 f-strings

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adslwang4601 picture adslwang4601  路  3Comments

josephhaaga picture josephhaaga  路  3Comments

WaylonWalker picture WaylonWalker  路  3Comments

yetudada picture yetudada  路  3Comments

yetudada picture yetudada  路  3Comments