Skip to content

Commit

Permalink
Removing UI changes
Browse files Browse the repository at this point in the history
Signed-off-by: Jitendra Gundaniya <[email protected]>
  • Loading branch information
jitu5 committed May 8, 2024
1 parent 9f2afa2 commit 35f1436
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
8 changes: 0 additions & 8 deletions package/kedro_viz/api/rest/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

# pylint: disable=missing-function-docstring, broad-exception-caught
import logging
from pathlib import Path
from typing import List

from fastapi import APIRouter
Expand All @@ -12,8 +11,6 @@
from kedro_viz.constants import PACKAGE_REQUIREMENTS
from kedro_viz.integrations.deployment.deployer_factory import DeployerFactory

# from kedro_viz.server import load_and_populate_data

from .responses import (
APIErrorMessage,
GraphAPIResponse,
Expand Down Expand Up @@ -62,12 +59,7 @@ async def get_single_pipeline_data(registered_pipeline_id: str):

@router.post("/deploy")
async def deploy_kedro_viz(input_values: DeployerConfiguration):
# Importing here to avoid circular imports
from kedro_viz.server import load_and_populate_data # pylint: disable=import-outside-toplevel

try:
load_and_populate_data(Path.cwd(), input_values.preview)

deployer = DeployerFactory.create_deployer(
input_values.platform, input_values.endpoint, input_values.bucket_name
)
Expand Down
2 changes: 1 addition & 1 deletion package/kedro_viz/data_access/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def add_is_preview_enabled_for_all_nodes(
):
"""Add the preview flag to the data access manager.
Args:
preview: A boolean flag to indicate whether the preview mode is enabled.
is_preview_enabled_for_all_nodes: A boolean flag to indicate whether the preview is enabled for all the nodes.
"""

self.is_preview_enabled_for_all_nodes = is_preview_enabled_for_all_nodes
Expand Down
10 changes: 7 additions & 3 deletions package/kedro_viz/launchers/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ def viz(ctx): # pylint: disable=unused-argument
help=PARAMS_ARG_HELP,
callback=_split_params,
)
@click.option("--preview", default=True, help="A flag to preview your node dataset")
@click.option(
"--preview",
default=True,
help="A flag to enable/disable a quick preview of node datasets.",
)
# pylint: disable=import-outside-toplevel, too-many-locals
def run(
host,
Expand Down Expand Up @@ -240,7 +244,7 @@ def run(
@click.option(
"--preview",
default=False,
help="A flag to preview your node dataset",
help="A flag to enable/disable a quick preview of node datasets.",
)
def deploy(platform, endpoint, bucket_name, include_hooks, preview):
"""Deploy and host Kedro Viz on provided platform"""
Expand Down Expand Up @@ -272,7 +276,7 @@ def deploy(platform, endpoint, bucket_name, include_hooks, preview):
@click.option(
"--preview",
default=False,
help="A flag to preview your node dataset",
help="A flag to enable/disable a quick preview of node datasets.",
)
def build(include_hooks, preview):
"""Create build directory of local Kedro Viz instance with Kedro project data"""
Expand Down
6 changes: 4 additions & 2 deletions package/kedro_viz/models/flowchart.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ def create_data_node(
tags: Set[str],
dataset: AbstractDataset,
stats: Optional[Dict],
is_preview_enabled_for_all_nodes: bool,
is_free_input: bool = False,
is_preview_enabled_for_all_nodes: bool = False,
) -> Union["DataNode", "TranscodedDataNode"]:
"""Create a graph node of type data for a given Kedro Dataset instance.
Args:
Expand All @@ -240,6 +240,7 @@ def create_data_node(
dataset: A dataset in a Kedro pipeline.
stats: The dictionary of dataset statistics, e.g.
{"rows":2, "columns":3, "file_size":100}
is_preview_enabled_for_all_nodes: A flag to enable/disable a quick preview of node datasets.
is_free_input: Whether the dataset is a free input in the pipeline
Returns:
An instance of DataNode.
Expand Down Expand Up @@ -565,6 +566,7 @@ class DataNode(GraphNode):
layer (Optional[str]): The layer that this data node belongs to. Defaults to `None`.
is_free_input (bool): Determines whether the data node is a free input. Defaults to `False`.
stats (Optional[Dict]): Statistics for the data node. Defaults to `None`.
is_preview_enabled_for_all_nodes (bool): A flag to enable/disable a quick preview of node datasets. Defaults to `False`.
Raises:
AssertionError: If kedro_obj, name are not supplied during instantiation
Expand All @@ -579,7 +581,7 @@ class DataNode(GraphNode):
stats: Optional[Dict] = Field(None, description="The statistics for the data node.")

is_preview_enabled_for_all_nodes: bool = Field(
None, description="The preview flag for all nodes"
False, description="A flag to enable/disable a quick preview of node datasets."
)

dataset_type: Optional[str] = Field(
Expand Down
2 changes: 1 addition & 1 deletion src/components/shareable-url-modal/shareable-url-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const ShareableUrlModal = ({ onToggleModal, visible }) => {
'Content-Type': 'application/json',
},
method: 'POST',
body: JSON.stringify({ ...inputValues, preview: false }), // preview appended to the body to disable the preview data
body: JSON.stringify(inputValues),
});
const response = await request.json();

Expand Down

0 comments on commit 35f1436

Please sign in to comment.