Closed dsmfreire closed 58 minutes ago
hi @dsmfreire - thanks so much for the detailed issue!
a couple points:
can you confirm that your example works on the fix-16101
branch?
uv pip install git+https://github.com/prefecthq/prefect.git@fix-16101
Bug summary
When settings the current profile to
ephemeral
using the CLI:And then importing the PREFECT_SERVER_ALLOW_EPHEMERAL_MODE setting, we can see that it is not set to the profile's value:
The profile's default value of
True
was expected. This resulted in being unable to run the API locally (Prefect expected PREFECT_API_URL to be set) even though the ephemeral profile was selected.Version info
Additional context
I looked through the source code and noticed the priority system for loading profile settings, with init variables, env filter, dotenv filter, file secret, prefect.toml, pyproject.toml and profiles.toml.
I suggest that we either have another source for the default profiles' settings as the last priority, or that the
ProfileSettingsTomlLoader._load_profile_settings
method loads settings from theDEFAULT_PROFILES_PATH
and then fill in missing values on the profile data fromself.profiles_path = _get_profiles_path()
.In this code region (between lines 146 and 148) https://github.com/PrefectHQ/prefect/blob/62b100162bed359b4eede533d302125ca4c85a3f/src/prefect/settings/sources.py#L146-L148
Have something like this:
I will happily work towards a PR if this makes sense to you. Thank you.