Skip to content

Commit

Permalink
Fix kedro viz --lite compatibility with Kedro 18 (#2102)
Browse files Browse the repository at this point in the history
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 (kedro-org/kedro#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 kedro-org/kedro#3920 (comment)
  • Loading branch information
rashidakanchwala authored Sep 19, 2024
1 parent 490416d commit 359fdd0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions package/kedro_viz/integrations/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,15 @@ def __init__(
self._data = data
self.metadata = metadata

def load(self, *args, **kwargs):
def _load(self, *args, **kwargs):
pass

def save(self, *args, **kwargs):
def _save(self, *args, **kwargs):
pass

load = _load
save = _save

def _exists(self):
pass

Expand Down

0 comments on commit 359fdd0

Please sign in to comment.