Skip to content

Commit

Permalink
🐛 🚑 Make MlflowArtifactDataset load and save compatible with modern d…
Browse files Browse the repository at this point in the history
…atasets without private _load and _save (#598)
  • Loading branch information
Galileo-Galilei committed Oct 15, 2024
1 parent ff7ba88 commit 8e5ed07
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [Unreleased]

### Fixed

:bug: :ambulance: Fix ``MlflowArtifactDataset`` ``load`` and ``save`` methods to make them compatible with modern datasets without private ``_load`` and ``_save`` introduced in ``kedro-datasets>=5.0.0`` ([#598](https://github.com/Galileo-Galilei/kedro-mlflow/issues/598))

## [0.13.1] - 2024-09-24

### Added
Expand Down
4 changes: 2 additions & 2 deletions kedro_mlflow/io/artifacts/mlflow_artifact_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def _save(self, data: Any):
# for logging on remote storage like Azure S3
local_path = local_path.as_posix()

if getattr(super().save, "__savewrapped__", False): # modern dataset
if hasattr(super().save, "__wrapped__"): # modern dataset
super().save.__wrapped__(self, data)
else: # legacy dataset
super()._save(data)
Expand Down Expand Up @@ -134,7 +134,7 @@ def _load(self) -> Any: # pragma: no cover
shutil.copy(src=temp_download_filepath, dst=local_path)

# finally, read locally
if getattr(super().load, "__loadwrapped__", False): # modern dataset
if hasattr(super().load, "__wrapped__"): # modern dataset
return super().load.__wrapped__(self)
else: # legacy dataset
return super()._load()
Expand Down

0 comments on commit 8e5ed07

Please sign in to comment.