-
Notifications
You must be signed in to change notification settings - Fork 113
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
Drop Kedro 17 #1669
Merged
Merged
Drop Kedro 17 #1669
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
load data from projects created in a range of Kedro versions. | ||
""" | ||
# pylint: disable=import-outside-toplevel, protected-access | ||
# pylint: disable=missing-function-docstring, no-else-return | ||
# pylint: disable=missing-function-docstring | ||
|
||
import base64 | ||
import json | ||
|
@@ -33,9 +33,6 @@ | |
from kedro.io import DataCatalog | ||
from kedro.io.core import get_filepath_str | ||
from kedro.pipeline import Pipeline | ||
from packaging.version import parse | ||
|
||
from kedro_viz.constants import KEDRO_VERSION | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
@@ -64,20 +61,9 @@ def _bootstrap(project_path: Path): | |
"""Bootstrap the integration by running various Kedro bootstrapping methods | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to keep this method? It's just the one way of bootstrapping now so you can also just call that directly. |
||
depending on the version | ||
""" | ||
if KEDRO_VERSION >= parse("0.17.3"): | ||
from kedro.framework.startup import bootstrap_project | ||
|
||
bootstrap_project(project_path) | ||
return | ||
|
||
if KEDRO_VERSION >= parse("0.17.1"): | ||
from kedro.framework.project import configure_project | ||
from kedro.framework.startup import _get_project_metadata | ||
|
||
package_name = _get_project_metadata(project_path).package_name | ||
from kedro.framework.startup import bootstrap_project | ||
|
||
configure_project(package_name) | ||
return | ||
bootstrap_project(project_path) | ||
|
||
|
||
def _get_dataset_stats(project_path: Path) -> Dict: | ||
|
@@ -128,67 +114,29 @@ def load_data( | |
""" | ||
_bootstrap(project_path) | ||
|
||
if KEDRO_VERSION >= parse("0.17.3"): | ||
from kedro.framework.project import pipelines | ||
|
||
with KedroSession.create( | ||
project_path=project_path, | ||
env=env, # type: ignore | ||
save_on_close=False, | ||
extra_params=extra_params, # type: ignore | ||
) as session: | ||
# check for --ignore-plugins option | ||
if ignore_plugins: | ||
session._hook_manager = _VizNullPluginManager() | ||
|
||
context = session.load_context() | ||
session_store = session._store | ||
catalog = context.catalog | ||
|
||
# Pipelines is a lazy dict-like object, so we force it to populate here | ||
# in case user doesn't have an active session down the line when it's first accessed. | ||
# Useful for users who have `get_current_session` in their `register_pipelines()`. | ||
pipelines_dict = dict(pipelines) | ||
stats_dict = _get_dataset_stats(project_path) | ||
|
||
return catalog, pipelines_dict, session_store, stats_dict | ||
elif KEDRO_VERSION >= parse("0.17.1"): | ||
with KedroSession.create( | ||
project_path=project_path, | ||
env=env, # type: ignore | ||
save_on_close=False, | ||
extra_params=extra_params, # type: ignore | ||
) as session: | ||
# check for --ignore-plugins option | ||
if ignore_plugins: | ||
session._hook_manager = _VizNullPluginManager() | ||
|
||
context = session.load_context() | ||
session_store = session._store | ||
stats_dict = _get_dataset_stats(project_path) | ||
|
||
return context.catalog, context.pipelines, session_store, stats_dict | ||
else: | ||
# Since Viz is only compatible with kedro>=0.17.0, this just matches 0.17.0 | ||
from kedro.framework.startup import _get_project_metadata | ||
|
||
metadata = _get_project_metadata(project_path) | ||
with KedroSession.create( | ||
package_name=metadata.package_name, | ||
project_path=project_path, | ||
env=env, # type: ignore | ||
save_on_close=False, | ||
extra_params=extra_params, # type: ignore | ||
) as session: | ||
# check for --ignore-plugins option | ||
if ignore_plugins: | ||
session._hook_manager = _VizNullPluginManager() | ||
|
||
context = session.load_context() | ||
session_store = session._store | ||
stats_dict = _get_dataset_stats(project_path) | ||
|
||
return context.catalog, context.pipelines, session_store, stats_dict | ||
from kedro.framework.project import pipelines | ||
|
||
with KedroSession.create( | ||
project_path=project_path, | ||
env=env, # type: ignore | ||
save_on_close=False, | ||
extra_params=extra_params, # type: ignore | ||
) as session: | ||
# check for --ignore-plugins option | ||
if ignore_plugins: | ||
session._hook_manager = _VizNullPluginManager() | ||
|
||
context = session.load_context() | ||
session_store = session._store | ||
catalog = context.catalog | ||
|
||
# Pipelines is a lazy dict-like object, so we force it to populate here | ||
# in case user doesn't have an active session down the line when it's first accessed. | ||
# Useful for users who have `get_current_session` in their `register_pipelines()`. | ||
pipelines_dict = dict(pipelines) | ||
stats_dict = _get_dataset_stats(project_path) | ||
|
||
return catalog, pipelines_dict, session_store, stats_dict | ||
|
||
|
||
# Try to access the attribute to trigger the import of dependencies, only modify the _load | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
packaging~=23.0 | ||
kedro>=0.17.5 | ||
kedro>=0.18.0 | ||
ipython>=7.0.0, <9.0 | ||
fastapi>=0.73.0,<0.200.0 | ||
pydantic<2 | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine to remove this note now the other one is in place.