Davi
08/29/2022, 12:36 PMmigrate__1 = configured(migration_func,
name="migrate__1")({"db_source": "database_name",
"schema_list": ["schema_name"]})
migrate__2 = configured(migration_func,
name="migrate__2")({"db_source": "database_name",
"schema_list": ["schema_name"]})
@job
def job_db_migration():
migrate__1()
migrate__2()
It works just fine. However I cant access/set the variables "_db_source_" and "_schema_list_" from the launchpad. If I write the following structure, it doesn't change the execution of the job:
{
ops: {
migrate__1: {
config: {
db_source: "db_name",
schema_list: ["schema_name_new"]
}
}
}
}
What am I doing wrong?
Thank you so much !jamie
08/29/2022, 4:39 PMconfigured
API sets the values for the configuration in code, so in your code snippet you are setting db_source
to database_name
. If you want to set values in the launchpad, instead you can define your job like this
@job
def job_db_migration():
migrate.alias("migrate__1")
migrate.alias("migrate__2")
Davi
08/30/2022, 8:35 AMjamie
08/30/2022, 2:54 PMmigrate__1 = configured(migration_func,
name="migrate__1")({"db_source": "database_1"})
migrate__2 = configured(migration_func,
name="migrate__2")({"db_source": "database_2"})
@job
def job_db_migration():
migrate__1()
migrate__2()
Davi
08/30/2022, 2:57 PMdagster._core.errors.DagsterInvalidConfigError: Error in config for solid 'apac_environment'
Error 1: Missing required config entry "execute" at path root:config. Sample config for missing entry: {'execute': True}
jamie
09/07/2022, 3:55 PMapac_environment
. is there anything with that name anywhere in your code?solid
are you using the @solid
decorator anywhere?Davi
09/08/2022, 9:03 AMapac_environment
, that's way on the error it uses the actual name on our production env. We have a bunch of different schemas on our migration process, but I called schema_1, schema_2, etc... to make it easier to understand here. :)https://dagster.slack.com/files/U03UW371YPN/F041EM1886Q/cleanshot_2022-09-07_at_10.32.44.png▾
jamie
09/08/2022, 3:01 PM@configured
decorator specifically, like this
@configured(
migration_func,
config_schema={"schema": str}
)
def migrate__1(config):
return {"db_source": "database_1", "schema": config["schema"]}
@configured(
migration_func,
config_schema={"schema": str}
)
def migrate__2(config):
return {"db_source": "database_1", "schema": config["schema"]}
@job
def job_db_migration():
migrate__1()
migrate__2()
i tried this out myself and it worked for me. sorry i missed this before and it took a while to get the correct code snippetDavi
09/13/2022, 8:27 AM