Charles Lariviere
11/29/2021, 4:45 PMcreate_database_schema()
op that I would like to either accept a name
config or input from another upstream op. I can make them both optional and raise an error if both are None
, but curious if there’s a better construct in the Dagster framework for something like this?max
11/29/2021, 5:04 PMCharles Lariviere
11/29/2021, 5:48 PM@op()
def create_database_schema(context, name: str):
context.database.create_schema(name)
And then be able to use it either as:
@job
def my_job():
schema = create_database_schema() # this is defined in the config
... = another_op(schema)
Or as:
@job
def my_job():
get_list_of_schema().map(lambda schema: create_database_schema(schema))
max
11/29/2021, 5:59 PMCharles Lariviere
11/29/2021, 6:42 PM