Derek
07/05/2024, 8:09 PMPREFECT_API_DATABASE_CONNECTION_URL
to a value during runtimeMarvin
07/05/2024, 8:09 PMPREFECT_API_DATABASE_CONNECTION_URL
during runtime:
python
import prefect
from prefect.settings import save_profile, load_profiles
# Create a profile
profile_name = "my_profile"
profile_config = {
"PREFECT_API_DATABASE_CONNECTION_URL": "your_connection_url_here"
}
save_profile(profile_name, profile_config)
# Load the profile and apply its settings
load_profiles(profile_name)
# Verify the settings
print(prefect.settings.get("PREFECT_API_DATABASE_CONNECTION_URL"))
This script creates a new profile with the desired configuration and then loads the profile, setting the PREFECT_API_DATABASE_CONNECTION_URL
to your specified value during runtime.
You can find more information and examples here and here.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.
Powered by