Skip to content
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

Preview dataset #1288

Merged
merged 47 commits into from
Mar 24, 2023
Merged
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
007f7c2
set up preview in response and flowchart.py
Huongg Mar 13, 2023
0ff46cf
return preview for metaData
Huongg Mar 13, 2023
e469560
filter data and render the table
Huongg Mar 14, 2023
38e641c
add preview-table component
Huongg Mar 15, 2023
4fd5136
fix styling for table in metadata panel
Huongg Mar 15, 2023
6ca4ec4
add previewTable to metadata-modal
Huongg Mar 15, 2023
36931d0
different theme for preview table
Huongg Mar 15, 2023
2abe3a6
add classname for preview-table
Huongg Mar 15, 2023
85dda7c
add size for PreviewTable
Huongg Mar 16, 2023
6aa6b6e
add cursor pointer
Huongg Mar 16, 2023
9a6eae7
styling for row hover state
Huongg Mar 16, 2023
dc19dd1
light and dark theme for hovering
Huongg Mar 17, 2023
d41b4f6
include excel and parquet dataset
Huongg Mar 17, 2023
5d775cf
Merge branch 'main' of github.com:kedro-org/kedro-viz into preview-da…
Huongg Mar 17, 2023
6e143f9
add margin for table large
Huongg Mar 17, 2023
de652bd
check if self.type is in preview_datasets
Huongg Mar 17, 2023
20bcefd
remove preview table style
Huongg Mar 17, 2023
6a90f53
add preview text
Huongg Mar 17, 2023
a7c07b0
Adding test for preview table
Huongg Mar 17, 2023
e7b1a56
adding condition to not call _preview if not existed
Huongg Mar 20, 2023
2ce39d0
move the hasAttr inside the previewDataSet loops
Huongg Mar 20, 2023
c6ec97a
update light theme colour for highlighting
Huongg Mar 20, 2023
0a6c107
onclick handler when clicking on small table
Huongg Mar 20, 2023
4c4a2a1
update release note
Huongg Mar 20, 2023
7990f5a
remove highlighting row in small table
Huongg Mar 20, 2023
3d1de36
update previewing message
Huongg Mar 20, 2023
1f578a5
update variable names
Huongg Mar 20, 2023
e5fab1d
pull changes from remote branch
Huongg Mar 20, 2023
15e61d4
Merge branch 'main' into preview-dataset
Huongg Mar 20, 2023
9869229
ignore updateContent file
Huongg Mar 21, 2023
bc7a12c
formatting
Huongg Mar 21, 2023
a772729
test_data_node_metadata_preview for flowchart.py
Huongg Mar 21, 2023
ed13b44
remove parquet dataset preview
Huongg Mar 21, 2023
bc25c3e
restructure data in preview table
Huongg Mar 22, 2023
e446fdd
update name to onExpandMetaDataClick
Huongg Mar 22, 2023
c726a7b
restructure the flowchart.py for _preview
Huongg Mar 22, 2023
36b7c66
update test to reflect the new data structure
Huongg Mar 22, 2023
3658109
adding test for flowchart.py
Huongg Mar 22, 2023
538cf9c
downgrade mypy package
Huongg Mar 22, 2023
63b0b7d
formatting
Huongg Mar 22, 2023
4f558c7
include # pylint: disable=attr-defined for _preview
Huongg Mar 22, 2023
8d5ed2a
include # type: ignore
Huongg Mar 22, 2023
1244076
include ignore in response
Huongg Mar 22, 2023
e3f7924
update wrong test name
Huongg Mar 23, 2023
9b89c6c
sticky header for preview table
Huongg Mar 23, 2023
0455310
feature flag and connect the preview data with config table
Huongg Mar 23, 2023
3d54783
use more generic classname for metadata modal
Huongg Mar 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions package/kedro_viz/models/flowchart.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,10 @@ def __post_init__(self, data_node: DataNode):
dataset_description = dataset._describe()
self.filepath = _parse_filepath(dataset_description)

if self.type in PREVIEW_DATASETS:
self.preview = dataset._preview(40)
# If the kedro-datasets is on the latest and does have the _preview
if (hasattr(dataset, '_preview')):
if self.type in PREVIEW_DATASETS:
Huongg marked this conversation as resolved.
Show resolved Hide resolved
self.preview = dataset._preview(40)
Copy link
Contributor

@datajoely datajoely Mar 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not make this configurable here?
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on our telemetry, hardly anyone uses this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's interesting. I would argue this is a slightly more compelling thing for users to actually change, but it's also something we can wait to see if users start asking for :)

Copy link
Contributor Author

@Huongg Huongg Mar 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is now done @datajoely 😄 I just included this today, by default this feature is always on unless user chooses to change it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it toggled or can they pass the preview number of rows?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is just toggled on and off at the moment, with the number of rows sets to 40


# Run command is only available if a node is an output, i.e. not a free input
if not data_node.is_free_input:
Expand Down