1.1 KiB
1.1 KiB
Config Package
Snowflake configuration management with dataclass hierarchy and TOML loading.
Modules
__init__.py - Configuration dataclass hierarchy:
ConnectionConfig,TimeoutConfig,CacheConfig,QueryConfig— Settings containersTableReference— Snowflake object reference withfully_qualified_namepropertyTablesConfig— Common table references (activity, patient, medication, organization)SnowflakeConfig— Root config aggregating all above +validate()andis_configuredpropertyload_snowflake_config(path=None)— Load from TOML, defaultconfig/snowflake.tomlget_snowflake_config()— Cached singleton accessreload_snowflake_config()— Force reload from disk
snowflake.toml — Snowflake connection settings (co-located with loader)
Key Details
- Uses
tomllib(Python 3.11+) withtomlifallback for 3.10 - Missing config file returns default SnowflakeConfig (no error)
- All dataclasses have sensible defaults (DATA_HUB.DWH, 24h cache TTL, etc.)
- Config is stateless but cached; call
reload_snowflake_config()to refresh