Ben
10/31/2025, 7:30 AM/Users/benjamingroves/playground/boxing-data/combat-data-pipelines/.venv/lib/python3.12/site-packages/pydantic_settings/main.py:425: UserWarning: Config key `pyproject_toml_table_header` is set in model_config but will be ignored because no PyprojectTomlConfigSettingsSource source is configured. To use this config key, add a PyprojectTomlConfigSettingsSource source to the settings sources via the settings_customise_sources hook.
self._settings_warn_unused_config_keys(sources, self.model_config)
/Users/benjamingroves/playground/boxing-data/combat-data-pipelines/.venv/lib/python3.12/site-packages/pydantic_settings/main.py:425: UserWarning: Config key `toml_file` is set in model_config but will be ignored because no TomlConfigSettingsSource source is configured. To use this config key, add a TomlConfigSettingsSource source to the settings sources via the settings_customise_sources hook.
self._settings_warn_unused_config_keys(sources, self.model_config)
I am using Macbook pro M1 Ventura, with Python 3 virtual env
python --version
Python 3.12.8
pip --version
pip 24.3.1Marvin
10/31/2025, 7:30 AMMarvin
10/31/2025, 7:32 AMpyproject_toml_table_header and toml_file) are present. It’s tracked here: PrefectHQ/prefect#19028. Functionality isn’t broken, but the warnings are noisy.
Quickest fix (recommended)
- Pin pydantic-settings to a version prior to 2.11 in your virtualenv:
pip install "pydantic-settings<2.11"
- If you maintain a requirements.txt/pyproject, add the same constraint there so it stays pinned.
You can confirm your version with:
python -c "import pydantic_settings as ps; print(ps.__version__)"
Optional: try updating Prefect first
- If you’re not on the latest Prefect 3.x, upgrade, then see if the warnings persist:
pip install -U prefect
If you still see the warnings afterward, apply the pin above.
If you need to temporarily silence the warnings (not ideal long-term)
- For CLI sessions only:
export PYTHONWARNINGS="ignore:Config key.*is set in model_config.*:UserWarning"
- Or in Python code (e.g., a bootstrap script):
import warnings
warnings.filterwarnings(
"ignore",
category=UserWarning,
message=r"Config key .* is set in model_config .*",
)
This suppresses more than just these two warnings, so prefer the dependency pin.
If you can, share your prefect version output — it helps confirm your Prefect/Pydantic/pydantic-settings versions. The command is:
prefect version
References
- Issue with context and workaround: PrefectHQ/prefect#19028
- Prefect settings overview (for background): Settings and profiles