Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add e2e test for lite mode and support earliest Kedro version #2148

Merged
merged 23 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
8830cab
sync remote
ravi-kumar-pilla Jul 28, 2024
0a5d1ae
Merge branch 'main' of https://github.com/kedro-org/kedro-viz
ravi-kumar-pilla Jul 30, 2024
bf47b47
merge main
ravi-kumar-pilla Aug 8, 2024
13e905b
Merge branch 'main' of https://github.com/kedro-org/kedro-viz
ravi-kumar-pilla Aug 13, 2024
3d6326c
Merge branch 'main' of https://github.com/kedro-org/kedro-viz
ravi-kumar-pilla Aug 21, 2024
3d3bdda
Merge branch 'main' of https://github.com/kedro-org/kedro-viz
ravi-kumar-pilla Aug 22, 2024
1abfc43
Merge branch 'main' of https://github.com/kedro-org/kedro-viz
ravi-kumar-pilla Sep 4, 2024
1461a3c
Merge branch 'main' of https://github.com/kedro-org/kedro-viz
ravi-kumar-pilla Sep 5, 2024
c3f7cc6
Merge branch 'main' of https://github.com/kedro-org/kedro-viz
ravi-kumar-pilla Sep 9, 2024
1831a39
Merge branch 'main' of https://github.com/kedro-org/kedro-viz
ravi-kumar-pilla Sep 12, 2024
db14971
Merge branch 'main' of https://github.com/kedro-org/kedro-viz
ravi-kumar-pilla Sep 17, 2024
93a7e28
merge main
ravi-kumar-pilla Sep 19, 2024
a7592a2
Merge branch 'main' of https://github.com/kedro-org/kedro-viz
ravi-kumar-pilla Sep 23, 2024
493f5d1
Merge branch 'main' of https://github.com/kedro-org/kedro-viz
ravi-kumar-pilla Sep 27, 2024
ab8a6b1
Merge branch 'main' of https://github.com/kedro-org/kedro-viz
ravi-kumar-pilla Sep 30, 2024
f715fdf
Merge branch 'main' of https://github.com/kedro-org/kedro-viz
ravi-kumar-pilla Oct 4, 2024
27c38dc
Merge branch 'main' of https://github.com/kedro-org/kedro-viz
ravi-kumar-pilla Oct 8, 2024
16a0435
Merge branch 'main' of https://github.com/kedro-org/kedro-viz
ravi-kumar-pilla Oct 10, 2024
5ccafb6
Merge branch 'main' of https://github.com/kedro-org/kedro-viz
ravi-kumar-pilla Oct 21, 2024
edbca63
add lite support for kedro 18 and add e2e test
ravi-kumar-pilla Oct 22, 2024
4d1e5eb
fix perm
ravi-kumar-pilla Oct 22, 2024
3485da7
use hasattr
ravi-kumar-pilla Oct 23, 2024
fbfce34
Merge branch 'main' into chore/e2e-lite-test
rashidakanchwala Oct 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions package/features/viz.feature
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ Feature: Viz plugin in new project
When I execute the kedro viz run command
Then kedro-viz should start successfully

Scenario: Execute viz lite with the earliest Kedro version that it supports
Given I have installed kedro version "0.18.3"
And I have run a non-interactive kedro new with pandas-iris starter
When I execute the kedro viz run command with lite option
Then kedro-viz should start successfully

Scenario: Execute viz lite with latest Kedro
Given I have installed kedro version "latest"
And I have run a non-interactive kedro new with spaceflights-pandas starter
Expand Down
9 changes: 8 additions & 1 deletion package/kedro_viz/data_access/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@

import networkx as nx
from kedro.io import DataCatalog
from kedro.io.core import DatasetError

try:
# kedro 0.18.11 onwards
from kedro.io.core import DatasetError
except ImportError: # pragma: no cover
# older versions
from kedro.io.core import DataSetError as DatasetError # type: ignore

from kedro.pipeline import Pipeline as KedroPipeline
from kedro.pipeline.node import Node as KedroNode
from sqlalchemy.orm import sessionmaker
Expand Down
15 changes: 14 additions & 1 deletion package/kedro_viz/integrations/kedro/abstract_dataset_lite.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,20 @@
import logging
from typing import Any, Optional

from kedro.io.core import AbstractDataset, DatasetError
try:
# kedro 0.18.11 onwards
from kedro.io.core import DatasetError
except ImportError: # pragma: no cover
# older versions
from kedro.io.core import DataSetError as DatasetError # type: ignore

try:
# kedro 0.18.12 onwards
from kedro.io.core import AbstractDataset
except ImportError: # pragma: no cover
# older versions
from kedro.io.core import AbstractDataSet as AbstractDataset # type: ignore


from kedro_viz.integrations.utils import UnavailableDataset

Expand Down
9 changes: 8 additions & 1 deletion package/kedro_viz/integrations/kedro/data_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,14 @@ def _load_data_helper(
# patch the AbstractDataset class for a custom
# implementation to handle kedro.io.core.DatasetError
if is_lite:
with patch("kedro.io.data_catalog.AbstractDataset", AbstractDatasetLite):
# kedro 0.18.12 onwards
if hasattr(sys.modules["kedro.io.data_catalog"], "AbstractDataset"):
abstract_ds_patch_target = "kedro.io.data_catalog.AbstractDataset"
else: # pragma: no cover
# older versions
abstract_ds_patch_target = "kedro.io.data_catalog.AbstractDataSet"

with patch(abstract_ds_patch_target, AbstractDatasetLite):
catalog = context.catalog
else:
catalog = context.catalog
Expand Down
7 changes: 6 additions & 1 deletion package/kedro_viz/integrations/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@

from typing import Any, Union

from kedro.io.core import AbstractDataset
try:
# kedro 0.18.12 onwards
from kedro.io.core import AbstractDataset
except ImportError: # pragma: no cover
# older versions
from kedro.io.core import AbstractDataSet as AbstractDataset # type: ignore

_EMPTY = object()

Expand Down
Loading