kedro-org / kedro-viz

Visualise your Kedro data and machine-learning pipelines and track your experiments.
https://demo.kedro.org
Apache License 2.0
682 stars 113 forks source link

Fix `kedro viz --lite` compatibility with Kedro 18 #2102

Closed rashidakanchwala closed 2 months ago

rashidakanchwala commented 2 months ago

Description

This is to get Kedro-viz (mainly kedro viz --lite) to work with Kedro 18 and some Kedro 19 versions based on changes this PR (https://github.com/kedro-org/kedro/pull/3920) introduced.

In July, Kedro made the _save and _load methods public. At that time, Kedro-viz did not rely on these methods. However, when we recently merged kedro viz --lite, we introduced an UnavailableDataset class, which is an AbstractDataset. This class now uses the public load and save methods. To maintain backward compatibility with older versions of the dataset, we followed a suggestion made by @deepyaman

class MyDataset(...):
    def _load(...) -> ...:
        ...

    load = _load

    def _save(...) -> ...:
        ...

    save = _save

Originally posted by @deepyaman in https://github.com/kedro-org/kedro/issues/3920#issuecomment-2176270399

QA notes

Checklist

astrojuanlu commented 2 months ago

Thanks @rashidakanchwala !

My only question (not a blocker) - any clue why this wasn't caught by unit tests?

rashidakanchwala commented 2 months ago

excellent question and I am going to create an issue around it today. Ideally; this should be caught by e2e testing which we don't have any for kedro viz --lite so I am going to ping Ravi to work on that.

Update - #2103

ravi-kumar-pilla commented 2 months ago

excellent question and I am going to create an issue around it today. Ideally; this should be caught by e2e testing which we don't have any for kedro viz --lite so I am going to ping Ravi to work on that.

Update - #2103

Thanks @rashidakanchwala for fixing the issue and creating the ticket. I did add one e2e test only against the "latest" Kedro version. I will add more in the ticket #2103 . Thank you !