-
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
Enable/disable preview for all the datasets when publishing Kedro-Viz from CLI #1894
Conversation
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: <>
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: ravi-kumar-pilla <[email protected]>
Signed-off-by: ravi-kumar-pilla <[email protected]>
Signed-off-by: ravi-kumar-pilla <[email protected]>
…ature/disable-preview Signed-off-by: ravi-kumar-pilla <[email protected]>
Signed-off-by: ravi-kumar-pilla <[email protected]>
Signed-off-by: ravi-kumar-pilla <[email protected]>
Signed-off-by: ravi-kumar-pilla <[email protected]>
Signed-off-by: ravi-kumar-pilla <[email protected]>
Signed-off-by: ravi-kumar-pilla <[email protected]>
Signed-off-by: ravi-kumar-pilla <[email protected]>
Signed-off-by: ravi-kumar-pilla <[email protected]>
Signed-off-by: ravi-kumar-pilla <[email protected]>
Signed-off-by: ravi-kumar-pilla <[email protected]>
Signed-off-by: ravi-kumar-pilla <[email protected]>
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.
Should we make a mention in the documentation?
There's also this ticket here #1705 , we can add this to next sprint. |
Signed-off-by: Jitendra Gundaniya <[email protected]>
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.
The code looks good, but I have some reservations about the naming of the new are_datasets_previewable
boolean. It's getting confusing with the is_preview_disabled
functionality we have.
@@ -452,7 +457,7 @@ def save_api_pipeline_response_to_fs(pipelines_path: str, remote_fs: Any): | |||
raise exc | |||
|
|||
|
|||
def save_api_responses_to_fs(path: str, remote_fs: Any): | |||
def save_api_responses_to_fs(path: str, remote_fs: Any, are_datasets_previewable: bool): |
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.
This is personal preference, but I would change are_datasets_previewable
to preview_datasets
.
To me are_datasets_previewable
sounds like it's checking whether it's possible to preview these datasets or not, where when reading the code it should mean whether preview has been enabled or not.
In my proposed change preview_datasets=True
means preview is enabled and preview_datasets=False
means it's disabled.
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.
okay, I too had a hard time renaming this :) .... so I want to make it differentiable to the is_preview_disabled
which corresponds to each instance of DataNodeMetadata class, where-as the plural form are_datasets_previewable
is a class variable. I personally prefer having is/are before a boolean variable/method to be clear of the return/data type.
cls.data_node.is_preview_disabled() | ||
or not hasattr(cls.dataset, "preview") | ||
or not cls.are_datasets_previewable |
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.
What's the difference here between cls.data_node.is_preview_disabled()
and cls.are_datasets_previewable
? Semantically, it sounds very similar, so I think we should think carefully about how these flags are named so it's easy to understand what's happening for future team members.
Also in terms of functionality, what does it mean for preview to be disabled on a node level vs class level?
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.
Agree with @merelcht.
i am also thinking for clarity we could possibly have :-
is_preview_disabled
on node level (and explain this in the docstring, that this disabled via node level happens when the user specifies 'preview=false' in the DataCatalog)is_all_previews_disabled
on class level (and once again explain in docstring this is to disable previews for all nodes and can be done via CLI and UI)
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.
@merelcht As discussed with @rashidakanchwala the existing is_preview_disabled
will rename to is_preview_enabled
and new boolean variable are_datasets_previewable
to is_all_previews_enabled
.
One thought is perhaps to name the new boolean after the new |
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: Jitendra Gundaniya <[email protected]>
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.
LGTM. Can we please also create a a ticket/PR to change is_preview_disabled
to is_preview_enabled
so it is consistent.
thanks both @jitu5 and @ravi-kumar-pilla :D
@rashidakanchwala Sure I will create a separate PR for change of |
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.
LGTM. Thank you
@stephkaiser Requesting you approval on disable preview from CLI, few days back, I demoed it you. please let me know if you have any questions. |
no questions from me! looks good, thanks Jitendra! |
# Conflicts: # package/kedro_viz/models/flowchart.py
Description
Resolves 1870
Development notes
--include-preview
flag added for Viz CLI:is_all_previews_enabled
forDataNodeMetadata
class which controls the enable/disable functionality for all the datasetsQA notes
kedro viz build --include-preview
to enable preview for all datasetskedro viz deploy --include-preview
to enable preview for all datasets in the deployed versionNOTE: As discussed with @rashidakanchwala and @stephkaiser ,
kedro viz run
will not have a preview flag and preview will be set to True by default. If the users want to change this behavior, they need to do this from UI. Designs will be updated soon (cc: @stephkaiser )Checklist
RELEASE.md
file