Ian Dias
06/28/2022, 6:46 AMchris
06/28/2022, 3:40 PMdwh_conn_str
as a dagster resource, but from your description it sounds like you defined it as an env var. Can you share a code snippet to show your use case?Ian Dias
06/28/2022, 10:04 PM@resource()
def dwh_conn_str(context):
return os.environ['DWH_CONN_STR']
chris
06/28/2022, 10:06 PMIan Dias
06/28/2022, 10:25 PM@io_manager(required_resource_keys={'dwh_conn_str', 'follower_conn_str'})
def lookout_db_io_manager(init_context):
""" wrapper per <https://docs.dagster.io/concepts/io-management/io-managers> """
return DatabaseIOManager() # This is a custom input manager
which feeds into the modes
mode_def_dwh = ModeDefinition(
"data_warehouse_mode",
resource_defs={
"io_manager": lookout_db_io_manager,
"dwh_conn_str": dwh_conn_str,
"follower_conn_str": follower_conn_str
},
)
When I run dagit in the UI, I select the data_warehouse_mode.
I'm a little confused about why this works normally - just not in debug mode. If that's the case then I'm assuming I don't need to put the required resource key in every solidchris
06/28/2022, 11:00 PM"env": {
"EARLIEST_TESTED_RELEASE": "0.12.12"
}
as part of your configuration.
2. We have a config type for passing env vars around called `StringSource`, which should help get better errors when things go wrong here.Ian Dias
06/29/2022, 12:42 AM