datajoely / kedro-rich

Make your Kedro experience snazzy
36 stars 4 forks source link

Overrides of the Kedro core library #9

Open datajoely opened 2 years ago

datajoely commented 2 years ago

In order to show some of the things that are possible via the rich library, some of the core Kedro library have been patched dynamically.

1. Logging Handler Override

This is already documented in #5 , the easiest solution would be to change this to the default in Kedro going forward.


2. Overriding the Node to string method:

kedro.pipeline.node.Node.__str__

This results in the node execution information being a bit cleaner and to the point. I've dropped the namespace information here since it is still sandwiched between catalog load/save operations that log that.

image vs image


2. Overriding the DataCatalog load/save methods:

kedro.io.data_catalog.DataCatalog.load|save

In the same vein changing the colours and the quote style instantly makes this look much snazzier:

image vs image


3. Provide nicer experience outside of a project

KedroCLI.get_command

I've always felt this behaviour has always catches beginners out. My implementation does this quite a drastic way, there are neater ways to do this here.

image vs image


4. Use rich_click where we can:

rich_click import RichGroup, RichCommand

This one I'm not as wedded to as the library is only on v1.2.1 at the time of writing. However it provides a really neat drop in replacement for click that seriously prettifies the help interface users get via the CLI:

image vs image