kedro
kedro copied to clipboard
Improve docstring for `add_feed_dict`
Description
In the catalog we have a method called add_feed_dict
. Which is arguably one of the worst named methods in the public API. Unfortunately, renaming it is a breaking change. For 0.20.0
we should totally rename it, but in the mean time we should add a better docstring explanation so that engineers working on this code can better understand what it does.
Context
This method was added a long time ago, likely even before Kedro was called Kedro, which git blame doesn't even know about. It was added before the catalog could be loaded from yaml
and is supposed to describe how data can be "fed" into the catalog dictionary. The term "feed_dict" might come from clojure or tensorflow lingo, nobody really remembers 🤷
I would consider introducing a more intuitive name, especially with newbies in mind. We can introduce the new name as an alias to ease breaking APIs.
Some ideas of the top of my head:
-
from_objects
-
from_dict
+1 to @datajoely 's idea because it also moves away from mutability
Solved in https://github.com/kedro-org/kedro/pull/4009