Hi Kedroids :party-parrot::robot_face:! I updated...
# questions
j
Hi Kedroids 🦜🤖! I updated my kedro viz to the latest version but now I'm unable to preview datasets as in the previous version... I got used to that feature 😄! Is there any way to have that back? I was checking the setting but there is nothing there neither. Thanks in advance!
n
I believe you need to specify it in the
catalog.yml
with
preview_args
, I am unsure about the default behavior. Pinging our viz team for proper response. @Rashida Kanchwala @Tynan?
r
yes @Nok Lam Chan is right. The version behind the settings panel on kedro-viz was experimental. In the latest Kedro-viz, we define the correct way to do it which is in your catalog.yml, you can specify the below
Copy code
dataset1:
  type: pandas.CSVDataSet
  filepath: ${base_location}/01_raw/companies.csv
  metadata:
    kedro-viz:
      layer: raw
      preview_args:
        nrows: 5
👍 1
👍🏽 1
n
Do we have it in our latest docs already?
r
I think it still needs to merge @Jo Stichbury @Ahdra Merali
a
Not yet; There’s a ticket for adding docs on using metadata in hooks: https://github.com/kedro-org/kedro/issues/2676, instructions on using it for preview should Viz should be added as part of that - I’ll make the edit
👍 3
👍🏼 1
j
It's failing on my end:
DataSetError:
__init__() got an unexpected keyword argument 'metadata'.
DataSet 'data_sql_clean' must only contain arguments valid for the constructor of 'kedro_datasets.pandas.csv_dataset.CSVDataSet'.
r
Hi Jose, I faced similar issue, doing -
pip install -U kedro-datasets
fixed for me. Thank you
j
Thank you @Ravi Kumar Pilla, now works like a charm 🤖!
🙂 2
Humble suggestion: It would be cool to have an option on the settings that let's you show the preview for all catalog entries. Now that I have to add this manually I miss the old behaviour even more 🥹!
👍🏼 1
👍 1
t
Thank you for the feedback! We'll note that and have actually had similar discussions within the team
n
I don’t hate the idea that if there is a default setting or front-end override mechanism, it could get a bit messy though.
☝️ 1
j
Not sure if overriding is the way to go, as you said it could get confusing (and even more in the future if we start being able to share the viz link to peers)... Maybe we can do something like: . • IF: user didn't expecify any "metadata/kedro viz" inside the catalog, then the default is to always show the head of every data on the viz. • ELSE: As long as there is at least one catalog entry with a "kedro viz" entry then assume the user will handle that going forward, thus removing the default for preview all other datasets... so the user will the one adding those tags to the yaml. . I think this, will be easier to understand to new people (that may not even be aware that this feature exists in the first place) Another advantage of making it default is that, when a new user of kedro viz does its first kedro-viz it can already see this feature working without any extra work. . I'm just thinking out loud, take it with a grain of salt. I know you are very capable of making this right 🙂
👍🏽 1
👍 1
👍🏼 1