Skip to content

Commit

Permalink
--include-preview flag added for CLI
Browse files Browse the repository at this point in the history
Signed-off-by: Jitendra Gundaniya <[email protected]>
  • Loading branch information
jitu5 committed May 20, 2024
1 parent 4f5c446 commit c815a9b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
16 changes: 8 additions & 8 deletions package/kedro_viz/launchers/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,11 @@ def run(
help="A flag to include all registered hooks in your Kedro Project",
)
@click.option(
"--preview",
default=False,
"--include-preview",
is_flag=True,
help="Enable/disable preview for all the datasets.",
)
def deploy(platform, endpoint, bucket_name, include_hooks, preview):
def deploy(platform, endpoint, bucket_name, include_hooks, include_preview):
"""Deploy and host Kedro Viz on provided platform"""
if not platform or platform.lower() not in SHAREABLEVIZ_SUPPORTED_PLATFORMS:
display_cli_message(
Expand All @@ -259,7 +259,7 @@ def deploy(platform, endpoint, bucket_name, include_hooks, preview):

create_shareableviz_process(
platform,
preview,
include_preview,
endpoint,
bucket_name,
include_hooks,
Expand All @@ -273,14 +273,14 @@ def deploy(platform, endpoint, bucket_name, include_hooks, preview):
help="A flag to include all registered hooks in your Kedro Project",
)
@click.option(
"--preview",
default=False,
"--include-preview",
is_flag=True,
help="Enable/disable preview for all the datasets.",
)
def build(include_hooks, preview):
def build(include_hooks, include_preview):
"""Create build directory of local Kedro Viz instance with Kedro project data"""

create_shareableviz_process("local", preview, include_hooks=include_hooks)
create_shareableviz_process("local", include_preview, include_hooks=include_hooks)


def create_shareableviz_process(
Expand Down
5 changes: 2 additions & 3 deletions package/tests/test_launchers/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,7 @@ def test_viz_command_group(mocker, mock_click_echo):
"http://example-bucket.s3-website.us-east-2.amazonaws.com/",
"--bucket-name",
"example-bucket",
"--preview",
"true",
"--include-preview",
],
{
"platform": "aws",
Expand Down Expand Up @@ -561,7 +560,7 @@ def test_viz_deploy_invalid_endpoint(mocker, mock_click_echo):
{"platform": "local", "include_hooks": True},
),
(
["viz", "build", "--preview", "true"],
["viz", "build", "--include-preview"],
{"platform": "local", "preview": True},
),
],
Expand Down

0 comments on commit c815a9b

Please sign in to comment.