I have some weirdness going on with a flow that pulls from Azure secrets into the prefect.config object(?) Anyways, the main issue is that the code gives this error
File "/mnt/data/prefect/venv/lib/python3.8/site-packages/box/box.py", line 490, in __getattr__
raise BoxKeyError(str(err)) from None
box.exceptions.BoxKeyError: "'Config' object has no attribute 'staging_db_constring'"
However if I attempt to print out the config object the code works as expected. I haven't touched the config.toml file and Googling hasn't helped. Any help would be appreciated. Thanks
k
Kevin Kho
04/27/2022, 5:44 PM
I am pretty confused what is going on here. How does it pull from Azure secrets into
prefect.config
? Do you have a task that pulls and then tries to set the value?
f
Frederick Thomas
04/27/2022, 5:44 PM
Yes!!
Frederick Thomas
04/27/2022, 5:45 PM
Hi btw
k
Kevin Kho
04/27/2022, 5:46 PM
I think what is happening is you are mutating the config in a task and calling it in a downstream task. The config/context can’t be mutated like this. Mutations to it don’t persist outside the current task. So you need to explicitly pass that secret downstream.
The way to persist data is the KV Store but that is not really meant to be sure so you pretty much need to pass it
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.