holoviz/lumen

Validate method does not notify on issues

Closed this issue · 2 comments

Expected this to raise an error on sourcezzzzzzzzz

import lumen as lm

data_url = 'https://datasets.holoviz.org/penguins/v1/penguins.csv'

pipeline = lm.Pipeline.validate({
    'sourcezzzzzzzzz': {
        'type': 'file',
        'tables': {
            'penguins': data_url
        }
    },
    'filters': [
        {'type': 'widget', 'field': 'species'},
        {'type': 'widget', 'field': 'island'},
        {'type': 'widget', 'field': 'sex'},
        {'type': 'widget', 'field': 'year'}
    ],
    'transforms': [
        {'type': 'aggregate', 'method': 'mean', 'by': ['species', 'sex', 'year']}
    ]
})

However, the CLI seems to work:

lumen validate spec.yaml
Dashboard component specification contained unknown key 'source'. Did you mean 'sources'?

    source:
      penguin_source:
        type: file
        tables:
          penguin_table: https://datasets.holoviz.org/penguins/v1/penguins.csv

Seems like Dashboard.validate() works

import lumen as lm

data_url = 'https://datasets.holoviz.org/penguins/v1/penguins.csv'

pipeline = lm.Dashboard.validate({
    'sourcezzzzzzzzz': {
        'type': 'file',
        'tables': {
            'penguins': data_url
        }
    },
    'filters': [
        {'type': 'widget', 'field': 'species'},
        {'type': 'widget', 'field': 'island'},
        {'type': 'widget', 'field': 'sex'},
        {'type': 'widget', 'field': 'year'}
    ],
    'transforms': [
        {'type': 'aggregate', 'method': 'mean', 'by': ['species', 'sex', 'year']}
    ]
})
ValidationError: Dashboard component specification contained unknown key 'sourcezzzzzzzzz'.

    sourcezzzzzzzzz:
      type: file
      tables:
        penguins: https://datasets.holoviz.org/penguins/v1/penguins.csv
    filters:
    - type: widget
      field: species
    - type: widget
      field: island
    - type: widget
      field: sex
    - type: widget
      field: year
    transforms:
    - type: aggregate
      method: mean
      by:
      - species
      - sex
      - year

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.