-
Notifications
You must be signed in to change notification settings - Fork 915
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
Add documentation for preview datasets in Kedro-viz #2773
Merged
+82
−0
Merged
Changes from 10 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
c534fb0
first draft
rashidakanchwala c189ae9
small typo
rashidakanchwala a88a923
Update docs/source/visualisation/preview_datasets.md
rashidakanchwala 92e0cb3
Update docs/source/visualisation/preview_datasets.md
rashidakanchwala fd33961
Merge branch 'main' into docs/kedro-viz-preview-data
stichbury 932b2e1
Add to index file and lint for whitespace issues
stichbury e5a9e6c
Update docs/source/visualisation/preview_datasets.md
rashidakanchwala f2a1ed4
Update docs/source/visualisation/preview_datasets.md
rashidakanchwala 3bb59ee
Update docs/source/visualisation/preview_datasets.md
rashidakanchwala ef1317f
fixes based on Jo's review
rashidakanchwala 24ffd02
add nrow to docs
rashidakanchwala f0b40be
Merge branch 'main' into docs/kedro-viz-preview-data
stichbury 03402e9
Merge branch 'main' into docs/kedro-viz-preview-data
rashidakanchwala 27d2fc6
Merge branch 'main' into docs/kedro-viz-preview-data
stichbury d1e5576
Merge branch 'main' into docs/kedro-viz-preview-data
rashidakanchwala 6519d6c
Merge branch 'main' into docs/kedro-viz-preview-data
rashidakanchwala f92f543
Merge branch 'main' into docs/kedro-viz-preview-data
rashidakanchwala File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,5 +13,6 @@ pip install kedro-viz | |
:maxdepth: 1 | ||
|
||
kedro-viz_visualisation | ||
preview_datasets | ||
visualise_charts_with_plotly | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# Preview data in Kedro-Viz | ||
|
||
This page describes how to preview data from different datasets in a Kedro project with Kedro-Viz. Dataset preview was introduced in Kedro-Viz version 6.3.0, which offers preview for `CSVDatasets` and `ExcelDatasets`. | ||
|
||
We use the [spaceflights tutorial](../tutorial/spaceflights_tutorial.md) to demonstrate how to add data preview for the `customer`, `shuttle` and `reviews` datasets. Even if you have not yet worked through the tutorial, you can still follow this example; you'll need to use the [Kedro starter for the spaceflights tutorial](https://github.com/kedro-org/kedro-starters/tree/main/spaceflights) to generate a copy of the project with working code in place. | ||
|
||
If you haven't installed Kedro [follow the documentation to get set up](../get_started/install.md). | ||
|
||
Then, in your terminal window, navigate to the folder you want to store the project. | ||
|
||
Generate a copy of the spaceflights tutorial project with all the code in place by using the [Kedro starter for the spaceflights tutorial](https://github.com/kedro-org/kedro-starters/tree/main/spaceflights): | ||
|
||
```bash | ||
kedro new --starter=spaceflights | ||
``` | ||
|
||
When prompted for a project name, you can enter anything, but we will assume `Spaceflights` throughout. | ||
|
||
When your project is ready, navigate to the root directory of the project. | ||
|
||
## Configure the Data Catalog | ||
|
||
Kedro-Viz version 6.3.0 currently supports preview of two types of datasets: | ||
|
||
* `pandas.CSVDataset` | ||
* `pandas.ExcelDataset` | ||
|
||
|
||
To enable the preview of these datasets, you need to add the `preview_args` attribute to the `kedro-viz` configuration under the `metadata` section in the Data Catalog: | ||
|
||
```yaml | ||
companies: | ||
type: pandas.CSVDataSet | ||
filepath: data/01_raw/companies.csv | ||
metadata: | ||
kedro-viz: | ||
layer: raw | ||
preview_args: | ||
nrows: 5 | ||
|
||
reviews: | ||
type: pandas.CSVDataSet | ||
filepath: data/01_raw/reviews.csv | ||
metadata: | ||
kedro-viz: | ||
layer: raw | ||
preview_args: | ||
nrows: 10 | ||
|
||
shuttles: | ||
type: pandas.ExcelDataSet | ||
filepath: data/01_raw/shuttles.xlsx | ||
metadata: | ||
kedro-viz: | ||
layer: raw | ||
preview_args: | ||
nrows: 15 | ||
``` | ||
|
||
|
||
|
||
## Previewing Data on Kedro-viz | ||
|
||
After you've configured the Data Catalog, you can preview the datasets on Kedro-Viz. Start Kedro-Viz by running the following command in your terminal: | ||
|
||
```bash | ||
kedro viz | ||
``` | ||
|
||
The previews are shown as follows: | ||
|
||
Click on each dataset node to see a small preview in the metadata panel: | ||
|
||
|
||
![](../meta/images/preview_datasets_metadata.png) | ||
|
||
|
||
View the larger preview of the dataset by clicking the `Expand Preview Table` button on the bottom of the metadata panel. | ||
|
||
|
||
![](../meta/images/preview_datasets_expanded.png) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can we also state that nrow is number of rows to be previewed?