Krishna Devenda
01/13/2021, 9:47 AMconfig.toml
by context provided in prefect UI's context section while running a flow?
I am facing problem with updating/overwriting context values from prefect UI. I have defined a user configuration file for the agent at
~/.prefect/config.toml
with following syntax
[context]
postgresdb = "production"
Now, I want to update this attribute postgredb
from the UI by passing context with same name and different value like following
{
"postgresdb": "test"
}
When I obtain this context name in task, it gives me the value from config.toml
not the updated value from the context provided in the UI
print(prefect.context.get('postgresdb'))
>>>production
Can someone guide me through this? Please.
I have read the documentation multiple times and have also gone through the prefect source code in an attempt to understand how contexts get merged but I could not understand it. From the code, it appears that whatever context is passed through **kwargs
overwrites the context in the config.toml
. I believe prefect UI is passing context via **kwargs
only.josh
01/13/2021, 2:14 PMKrishna Devenda
01/13/2021, 4:35 PMKrishna Devenda
01/13/2021, 6:05 PMjosh
01/13/2021, 6:08 PM