Comments (1)
In pydantic-settings V2
(current major version), you can't access the values loaded by other settings sources.
There is an open issue for that.
You can have a different settings class for this and load it before.
class AzureKeyVaultSettings(BaseSettings):
url: str
class ApplicationSettings(BaseSettings):
@classmethod
def settings_customise_sources(
cls,
settings_cls: Any,
init_settings: PydanticBaseSettingsSource,
env_settings: PydanticBaseSettingsSource,
dotenv_settings: PydanticBaseSettingsSource,
file_secret_settings: PydanticBaseSettingsSource,
) -> Tuple[PydanticBaseSettingsSource]:
s = AzureKeyVaultSettings()
return (
env_settings,
AzureKeyVaultSettingsSource(
settings_cls,
s.url,
DefaultAzureCredential()
),
)
from pydantic-settings.
Related Issues (20)
- TypeError: issubclass() arg 1 must be a class for list[] config HOT 5
- Parsing nested argument of type list fails with `cli_parse_args` and `alias_generator` HOT 8
- Add AWS SSM Parameter Store support
- Mypy reports error when passing a list to YamlConfigSettingsSource through yaml_file HOT 1
- Mypy plugin reports false positives and not existing lines HOT 1
- Ignore unknown sys.argv HOT 5
- Support dash-separated CLI arguments and underscore-separated ENV variables HOT 4
- context not passed to field validators HOT 4
- Order of alias given in AliasChoices yield different results HOT 3
- add an option to not validate a model if all configuration options it contains are empty HOT 2
- reconsider adding Singleton option for BaseSettings HOT 4
- AzureKeyVaultSettingsSource ignoring SettingsSource Priority HOT 3
- PyprojectTomlConfigSettingsSource overwrite `toml_file` Path from `model_config` HOT 2
- Feature: Make argument flag configurable HOT 5
- support regex to load config that falls under the same roof HOT 2
- Regression of case sensitive environment variable support HOT 7
- Regression - .env nested optional model support HOT 4
- Add SOPS settings source for secrets HOT 1
- pydantic-settings new version can't handle scenario HOT 2
- Allow to load a settings without validation HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pydantic-settings.