kedro-org / kedro-plugins

First-party plugins maintained by the Kedro team.
Apache License 2.0
94 stars 90 forks source link

Make layer less verbose #774

Closed pascalwhoop closed 1 month ago

pascalwhoop commented 4 months ago

Hi y'all

we recently switched from

layer: foo

to

  metadata:
    kedro-viz:
      layer: 04_features

that's super verbose. Can we please get

  metadata.kedro-viz.layer: 01_raw

? Else the catalog just becomes suuuuper verbose. There must be a way to be yaml compliant when writing catalog yaml no?

pascalwhoop commented 4 months ago

I know this is probably kedro datasets originating, then let's fix it there :)

astrojuanlu commented 4 months ago

There must be a way to be yaml compliant when writing catalog yaml no?

The closest YAML-compliant, 1 liner I can think of that achieves the same structure is

ds:
  type: ...
  metadata: {"kedro-viz": {"layer": "04_features"}}

But that's even more annoying to type... (unsure if these are "Flow style" or "Block style" as per the YAML spec)

This is hardly a kedro-viz issue though, moving it to kedro-plugins for now

noklam commented 2 months ago

There must be a way to be yaml compliant when writing catalog yaml no?

I am happy if this exists, as of the moment the issue hasn't been addressed, see https://github.com/omry/omegaconf/issues/1188

Alternatlively, you can remove some typing with variable interpolation?

catalog.yml

_viz_feature_layer:
  kedro-viz:
    layer: 04_features

my_dataset:
  ...
  metadata: ${_viz_feature_layer}

?

astrojuanlu commented 1 month ago

Also see https://github.com/kedro-org/kedro-viz/issues/2127

merelcht commented 1 month ago

Discussed this in backlog grooming and we decided to not change anything about the layer definition. The metadata key was introduced to allow more flexible entries in the datacatalog for plugins (like Kedro-Viz).

astrojuanlu commented 1 month ago

And to clarify, there are ways to make this simpler, like YAML anchors https://github.com/kedro-org/kedro-viz/issues/2127 or even Omegaconf variables