matas
08/02/2020, 3:24 PMcategories:
home:
- {source: foo, mult: 1}
business:
- {source: bar, mult: 2}
- {source: baz, mult: 3}
...
Here I have a dictionary with different keys (which I want to use as meaningfull values - home, business, etc) and an array of structured values (each one is {source: str, mult: int})
I see 3 ways now, all of them are quite cumbersome:
• just use a Permissive for all the config - I would loose validation at the last leaf level, that's pitty
• change the shape of config to have
categories:
- name: home
sources:
- {source: foo, mult: 1}
- name: business
sources:
- {source: bar, mult: 2}
- {source: baz, mult: 3}
...
looks ugly adding unnecessary 'name' and 'sources'
• create my own DagsterType for the whole config - looks a little like overkill here.
So am I missing something? Is there a better way or what should be more "dagsterish"? Dmatas
08/02/2020, 3:45 PMmatas
08/02/2020, 9:21 PMmax
08/02/2020, 10:18 PMSelector
matas
08/02/2020, 10:28 PMmatas
08/02/2020, 10:35 PMcategories:
- name: home
sources:
- {source: foo, formula: '2*foo'}
- name: business
sources:
- {source: bar, formula: 'bar**2'}
- {source: baz, formula: 'baz+3'}
And I'd like to reuse loading\validation code for Formula type between my solids and pipelines schemas, so it looks naturally like a custom type. But when I try to use it as a part of config_shema I get a DagsterInvalidConfigDefinitionErrorschrockn
08/02/2020, 11:51 PMcategories:
home:
- {source: foo, mult: 1}
business:
- {source: bar, mult: 2}
- {source: baz, mult: 3}
...
I believe in order to get what you want you want a list of selectors. Each item in the list would be a dictionary with a single key home
or business
categories:
- home:
- {source: foo, mult: 1}
- business:
- {source: bar, mult: 2}
- {source: baz, mult: 3}
...
matas
08/03/2020, 7:27 AMmatas
08/04/2020, 11:49 AM