-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add UnavailableDataset as a default dataset for lite mode (#2083)
* sync remote * fallback dataset for lite * update file permissions * update release note * fix tests
- Loading branch information
1 parent
d3fc51f
commit c90e723
Showing
9 changed files
with
67 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
"""`kedro_viz.integrations.utils` provides utility functions and classes | ||
to integrate Kedro-Viz with external data sources. | ||
""" | ||
|
||
from typing import Any, Union | ||
|
||
from kedro.io.core import AbstractDataset | ||
|
||
_EMPTY = object() | ||
|
||
|
||
class _VizNullPluginManager: # pragma: no cover | ||
"""This class creates an empty ``hook_manager`` that will ignore all calls to hooks | ||
and registered plugins allowing the runner to function if no ``hook_manager`` | ||
has been instantiated. | ||
NOTE: _VizNullPluginManager is a clone of _NullPluginManager class in Kedro. | ||
This was introduced to support the earliest version of Kedro which does not | ||
have _NullPluginManager defined | ||
""" | ||
|
||
def __init__(self, *args, **kwargs): | ||
pass | ||
|
||
def __getattr__(self, name): | ||
return self | ||
|
||
def __call__(self, *args, **kwargs): | ||
pass | ||
|
||
|
||
class UnavailableDataset(AbstractDataset): # pragma: no cover | ||
"""This class is a custom dataset implementation for `Kedro Viz Lite` | ||
when kedro-datasets are unavailable""" | ||
|
||
def __init__( | ||
self, | ||
data: Any = _EMPTY, | ||
metadata: Union[dict[str, Any], None] = None, | ||
): | ||
self._data = data | ||
self.metadata = metadata | ||
|
||
def load(self, *args, **kwargs): | ||
pass | ||
|
||
def save(self, *args, **kwargs): | ||
pass | ||
|
||
def _exists(self): | ||
pass | ||
|
||
def _describe(self) -> dict[str, Any]: | ||
return {"data": self._data} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters