HomePhabricator

(scalar-unions-2) Add ScalarUnion Type

Authored by schrockn on Dec 20 2019, 4:59 PM.

Description

(scalar-unions-2) Add ScalarUnion Type

Summary:
Adds a new type to the config system: ScalarUnionType.

This allows one to specify config schema that accepts a scalar value
OR a non-scalar value like a List, Dict, or Selector. This way the parse
is unambiguous (as far as I know)

The motivation here is to allow runtime scalars to be configured without
a dictionary with the key "value" and instead just use the scalar value
directly. However we still also want to leave the option to load scalars
from a json or pickle file.

e.g.

solids:
  multiply_the_word:
    inputs:
      word:
        value: bar

becomes, optionally,

solids:
  multiply_the_word:
    inputs:
      word: bar

Depends on D1734

Test Plan: BK

Reviewers: max, alangenfeld

Reviewed By: alangenfeld

Differential Revision: https://dagster.phacility.com/D1732

Details

Committed
schrocknJan 7 2020, 8:45 PM
Reviewer
alangenfeld
Differential Revision
D1732: (scalar-unions-2) Add ScalarUnion Type
Parents
R1:38ef749f572f: Add missing where clause to event storage
Branches
Unknown
Tags
Unknown