HomePhabricator

Add wrapper for Python enums in Dagster configs. (#2046)

Authored by Kevin Dungs <kdungs@users.noreply.github.com> on Jan 7 2020, 5:56 PM.

Description

Add wrapper for Python enums in Dagster configs. (#2046)

This adds Enum.from_python_enum which takes a Python enum (i.e.
something inheriting from EnumMeta) and builds a Dagster Enum from it.

Each value is represented by its name on config level but the
corresponding python_value is the enum value itself.

Also adds two tests:

  • Test that Enum created from this method can be used in a solid config.
  • Test for comprehensiveness: all enum values actually have a corresponding EnumValue.

Details

Committed
alangenfeldJan 7 2020, 5:56 PM
Parents
R1:7a30835a1a30: Increase pod startup timeout
Branches
Unknown
Tags
Unknown

Event Timeline

alangenfeld committed R1:d6071f988b35: Add wrapper for Python enums in Dagster configs. (#2046) (authored by Kevin Dungs <kdungs@users.noreply.github.com>).Jan 7 2020, 5:56 PM