Hi,
Can someone explain me how from we read configuration in prefect 2 from config.toml file
earlier we were using
from prefect import config
what do we use in prefect 2 ?
m
Mark NS
01/20/2023, 11:10 AM
Hi Hamza, I'm not sure if this is exactly what you're looking for, but I've found it useful to look at the cli code in some cases. For example in
prefect.cli.config.py
you'll see:
Copy code
context = prefect.context.get_settings_context()
# Get settings at each level, converted to a flat dictionary for easy comparison
default_settings = prefect.settings.get_default_settings()
env_settings = prefect.settings.get_settings_from_env()
current_profile_settings = context.settings
h
Hamza Kazmi
01/20/2023, 11:31 AM
@Mark NS, i am specifically looking how i can read configuration from toml file in prefect 2, not sure if this allow us to do that but i can check and see if it works for me.
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.