Phil Landin
03/28/2023, 3:50 PMdefs = Definitions(
jobs=[
pq_first_load_graph.to_job(
resource_defs={'s3': s3_res},
config={
'ops': {
'get_city_data': {
'config': {
'cities': {'env': 'CITIES'}
}
}
}
}
)
]
)
When I run "dagster dev -f <job_file>", I get the following error:
dagster._core.errors.DagsterInvalidConfigError: Invalid default_value for Field. Error 1: Invalid scalar at path root:get_city_data:config:cities. Value "{'env': 'CITIES'}" of type "<class 'dict'>" is not valid for expected type "String".
Any ideas on what I'm doing wrong? Also, out of curiosity, once I solve this issue, will I have to manually enter the cities value in the job launchpad? I had previously been using os.getenv to load the environmental variables and couldn't figure out a way to get around entering them manually in the launchpad.sean
03/28/2023, 4:28 PMStringSource
set in the config schema for your get_city_data
op, see here: https://docs.dagster.io/concepts/configuration/config-schema#passing-secrets-as-configuration
I recognize that that snippet of docs you linked is misleading because it does not include this, I will fix it.Also, out of curiosity, once I solve this issue, will I have to manually enter the cities value in the job launchpad? I had previously been using os.getenv to load the environmental variables and couldn’t figure out a way to get around entering them manually in the launchpad.You shouldn’t need to do this if you have a
.env
file with the necessary values in the folder where dagit is launched.Phil Landin
03/28/2023, 4:54 PM