Dave W
12/27/2019, 7:04 PMDave W
12/27/2019, 7:05 PMDave W
12/27/2019, 7:06 PMDave W
12/27/2019, 7:47 PMKevin
01/06/2020, 3:20 PMdef as_dagster_enum(e: enum.EnumMeta):
return Enum(e.__name__, [EnumValue(v.name, python_value=v) for v in e])
You can then use it in your solid config like so
class Strategy(enum.Enum):
SOMETHING = enum.auto()
SOMETHING_ELSE = enum.auto()
@solid(
config={"strategy": Field(as_dagster_enum(Strategy)),
…
)
…
Bob
01/07/2020, 4:20 PMVitor Avancini
01/07/2020, 6:04 PMVitor Avancini
01/07/2020, 6:04 PMVitor Avancini
01/07/2020, 6:06 PMVitor Avancini
01/07/2020, 6:07 PMmax
01/07/2020, 6:07 PMVitor Avancini
01/07/2020, 6:08 PMVitor Avancini
01/07/2020, 8:04 PMdwall
01/07/2020, 9:31 PMVitor Avancini
01/07/2020, 10:12 PMtseader
01/09/2020, 6:49 PMuser
01/10/2020, 11:45 PMmax
01/10/2020, 11:46 PMschrockn
01/11/2020, 12:26 AMDict
has been renamed to `Shape`; List
to `Array`; Optional
to `Noneable`; and PermissiveDict
to Permissive
. The motivation here is to clearly delineate config use cases versus cases where you are using types as the inputs and outputs of solids as well as python typing types (for mypy and friends). We believe this will be clearer to users in addition to simplifying our own implementation and internal abstractions.
Our recommended fix is not to used Shape and Array, but instead to use our new condensed config specification API. This allow one to use bare dictionaries instead of Shape
, lists with one member instead of Array
, bare types instead of Field
with a single argument, and python primitive types (int
, bool
etc) instead of the dagster equivalents. These result in dramatically less verbose config specs in most cases.
So instead of
from dagster import Shape, Field, Int, Array, String
# ... code
config=Shape({ # Dict prior to change
'some_int' : Field(Int),
'some_list: Field(Array[String]) # List prior to change
})
one can instead write:
config={'some_int': int, 'some_list': [str]}
No imports and much simpler, cleaner syntax.Cam Peterson
01/13/2020, 11:20 PMCam Peterson
01/13/2020, 11:20 PMalembic.util.exc.CommandError: Path doesn't exist: '/Users/campeterson/anaconda3/envs/dagster/lib/python3.7/site-packages/dagster/core/storage/runs/sqlite/alembic/'. Please use the 'init' command to create a new scripts folder.
Cam Peterson
01/13/2020, 11:21 PMuser
01/14/2020, 12:52 AMswenzel
01/14/2020, 10:50 AMNewander
01/14/2020, 11:06 AMalembic.util.exc.CommandError: Path doesn't exist: '/home/newander/PycharmProjects/etl-backend/venv/lib/python3.8/site-packages/dagster/core/storage/runs/sqlite/alembic/'. Please use the 'init' command to create a new scripts folder.
As I may see, this error was occurred by the next causes:
I want to use postgresql as storage and add it to `repository.yaml`:
storage:
run_storage:
module: dagster_postgres.run_storage
class: PostgresRunStorage
config:
postgres_url: "<postgresql://postgres:123>@localhost:5432/etl_backend"
event_log_storage:
module: dagster_postgres.event_log
class: PostgresEventLogStorage
config:
postgres_url: "<postgresql://postgres:123>@localhost:5432/etl_backend"
But when I tried to start with dagster schedule up -y repository.yaml
I received the error above. I think this error is about the dagster/cli/schedule.py:157
code line where don't specified config.yaml
and using default where specified SQL database.
So, can you help me with it? (I can write pull request to fix CLI schedule up command but it will be too long)
Aaand the next question: what settings I need to add into yaml to specify script/version directory for Alembic?schrockn
01/14/2020, 6:00 PMAmanda Crawford
01/15/2020, 3:29 PMaqm
01/16/2020, 5:10 AMfred
01/21/2020, 7:33 AMdwall
01/21/2020, 10:05 PM