-
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
Refactor datasets #1698
Refactor datasets #1698
Conversation
Signed-off-by: Rashida Kanchwala <[email protected]>
Signed-off-by: Rashida Kanchwala <[email protected]>
Co-authored-by: Nok Lam Chan <[email protected]>
Signed-off-by: Rashida Kanchwala <[email protected]>
Signed-off-by: Sajid Alam <[email protected]>
Signed-off-by: Sajid Alam <[email protected]>
Can the PR description be updated to add some context? It will make it easier to review. |
Signed-off-by: ravi-kumar-pilla <[email protected]>
Hi @SajidAlamQB, The reason tests are failing for python3.8 is |
@ravi-kumar-pilla I think it's fine to drop Python 3.8 support, with the caveat that is it easy for user find out which version to install? If an user is using Python 3.8, which combination of kedro/kedro-datasets/kedro-viz would work for them? It's a result of kedro-plugins (at least kedro-datasets) are moving faster and we are following https://endoflife.date/python. |
We need to add/update the compatibility matrix in the ReadME which includes kedro-viz/kedro/kedro-datasets.
Got it ! |
def is_preview_disabled(self): | ||
"""Checks if the dataset has a preview disabled""" | ||
if self.viz_metadata: | ||
preview_value = self.viz_metadata.get("preview") | ||
return preview_value is not None and not preview_value | ||
return False |
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.
def is_preview_disabled(self): | |
"""Checks if the dataset has a preview disabled""" | |
if self.viz_metadata: | |
preview_value = self.viz_metadata.get("preview") | |
return preview_value is not None and not preview_value | |
return False | |
def is_preview_disabled(self): | |
"""Checks if the dataset has a preview disabled""" | |
if self.viz_metadata: | |
preview_value = self.viz_metadata.get("preview") | |
return preview_value is not None and not preview_value | |
return False |
I found this complicated, can we assume it's True unless specified as False?
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.
+1
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.
Maybe something like this:
def is_preview_disabled(self): | |
"""Checks if the dataset has a preview disabled""" | |
if self.viz_metadata: | |
preview_value = self.viz_metadata.get("preview") | |
return preview_value is not None and not preview_value | |
return False | |
def is_preview_disabled(self): | |
"""Checks if the dataset has a preview disabled""" | |
return self.viz_metadata and self.viz_metadata.get("preview") is False |
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.
so, the preview feature is always enabled unless the user specifies viz_metadata: preview: false
? @rashidakanchwala
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.
yup, that's true. by default
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.
if self.viz_metadata is None, the function will return None. Can we have a return value of boolean in all cases ? Can we do something like - return viz_metadata is not None and viz_metadata.get("preview") is False
. Thank you
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.
ok have more clarity on what you and @merelcht meant. It returns None
so i have changed it to return bool as suggested-- now it will always return False except when preview: False
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.
Front end part looks good me!
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 left one more question and wanted to check again if the docs will also be updated before release?
Otherwise, this looks all good from a code point of view 👍
Co-authored-by: Merel Theisen <[email protected]>
Yes, before the release the docs will be updated. I will create a PR tomm for the docs. |
LGTM. Awesome work !! @rashidakanchwala We need to make sure to revert the kedro-datasets source in |
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.
Thanks for clarifying my earlier question @rashidakanchwala. This looks good to be merged now ⭐ 👍
Thanks team. I am pushing this, I will revert the dependencies once |
Description
Related to: #1700
Kedro-Viz
andKedro-Datasets
are tightly coupled , leading to issues where modifications inKedro-Datasets
can disrupt the functionality ofKedro-Viz
. This ticket aims to refactor the codebase to enhance modularity and stability. The goal is to decouple the two components, allowing for smoother integration in the future without excessive interdependencies.Development notes
We've moved the logic for generating previews for several datasets from
kedro-viz
tokedro-datasets
, reducing the coupling betweenkedro-viz
andkedro-datasets
.Previews are rendered differently in the front-end, so we've introduced aliasing using NewType. Currently, we support four types of previews in the front-end: json, image [png], plotly, and dataframe [as tables]. Users can enable previews for custom datasets as long as they fall into one of these categories.
Previously, we utilized the
load
function and overrode it in kedro-viz to load dataset previews. However, this logic has been migrated to kedro-datasets within thepreview()
function. In the kedro-viz API, we no longer includeplot
,image
, ortracking_data
as fields of DataNodeMetadata. Instead, we now only sendpreview
andpreview_type
.Preview
can be a preview of any dataset that has the preview function, andpreview_type
informs the front-end on how to render the preview.QA notes
Checklist
RELEASE.md
file