Models Reference¶
Auto-generated API documentation for brix Pydantic models.
Profile Models¶
brix.modules.dbt.profile.models
¶
Pydantic models for dbt profile configuration.
These models provide type-safe parsing and validation of dbt profiles.yml files. Supports DuckDB and Databricks adapters.
DuckDbOutput
¶
Bases: BaseModel
DuckDB adapter output configuration.
Supports all dbt-duckdb adapter options including extensions and settings.
Source code in src/brix/modules/dbt/profile/models.py
sync_database_with_memory_path()
¶
Set database to 'memory' when path is ':memory:' for dbt-duckdb compatibility.
Source code in src/brix/modules/dbt/profile/models.py
DatabricksOutput
¶
Bases: BaseModel
Databricks adapter output configuration.
Supports multiple authentication methods: - Token-based: Personal Access Token (PAT) - OAuth U2M: User-to-machine (browser-based, no secrets needed) - OAuth M2M (AWS/GCP): Machine-to-machine with client_id/client_secret - OAuth M2M (Azure): Machine-to-machine with azure_client_id/azure_client_secret
Source code in src/brix/modules/dbt/profile/models.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | |
strip_host_protocol(v)
classmethod
¶
Strip http:// or https:// prefix from host if present.
Source code in src/brix/modules/dbt/profile/models.py
ensure_http_path_starts_with_slash(v)
classmethod
¶
Ensure http_path starts with /.
Source code in src/brix/modules/dbt/profile/models.py
validate_threads(v)
classmethod
¶
Ensure threads is at least 1.
validate_connect_retries(v)
classmethod
¶
Ensure connect_retries is non-negative.
Source code in src/brix/modules/dbt/profile/models.py
validate_auth_method()
¶
Validate that exactly one authentication method is configured.
Valid configurations: - token alone (PAT) - auth_type='oauth' alone (U2M) - auth_type='oauth' + client_id + client_secret (M2M AWS/GCP) - auth_type='oauth' + azure_client_id + azure_client_secret (M2M Azure)
Source code in src/brix/modules/dbt/profile/models.py
ProfileTarget
¶
Bases: BaseModel
A dbt profile with target selection and output configurations.
Source code in src/brix/modules/dbt/profile/models.py
DbtProfiles
¶
Bases: BaseModel
Root model for profiles.yml - a mapping of profile names to configurations.
Source code in src/brix/modules/dbt/profile/models.py
__getitem__(key)
¶
__contains__(key)
¶
from_yaml(content)
classmethod
¶
Parse profiles from YAML string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
content
|
str
|
YAML string content of profiles.yml |
required |
Returns:
| Type | Description |
|---|---|
DbtProfiles
|
Parsed DbtProfiles instance |
Raises:
| Type | Description |
|---|---|
ValueError
|
If YAML is invalid or doesn't match schema |
Source code in src/brix/modules/dbt/profile/models.py
from_file(path)
classmethod
¶
Load profiles from a file path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
Path to profiles.yml file |
required |
Returns:
| Type | Description |
|---|---|
DbtProfiles
|
Parsed DbtProfiles instance |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If file doesn't exist |
ValueError
|
If YAML is invalid or doesn't match schema |
Source code in src/brix/modules/dbt/profile/models.py
to_yaml()
¶
Serialize profiles to YAML string.
Returns:
| Type | Description |
|---|---|
str
|
YAML string representation |
Source code in src/brix/modules/dbt/profile/models.py
Project Models¶
brix.modules.dbt.project.models
¶
Pydantic models for dbt project configuration.
These models provide type-safe parsing and validation of dbt_project.yml and packages.yml files.
ProjectNameError
¶
PackageNameError
¶
DbtProject
¶
Bases: BaseModel
Pydantic model for dbt_project.yml configuration.
Represents the structure and configuration options for a dbt project. Supports YAML serialization via from_yaml() and to_yaml() methods.
Source code in src/brix/modules/dbt/project/models.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | |
validate_name(v)
classmethod
¶
from_yaml(content)
classmethod
¶
Parse project configuration from YAML string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
content
|
str
|
YAML string content of dbt_project.yml |
required |
Returns:
| Type | Description |
|---|---|
DbtProject
|
Parsed DbtProject instance |
Raises:
| Type | Description |
|---|---|
ValueError
|
If YAML is invalid or doesn't match schema |
Source code in src/brix/modules/dbt/project/models.py
from_file(path)
classmethod
¶
Load project configuration from a file path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
Path to dbt_project.yml file |
required |
Returns:
| Type | Description |
|---|---|
DbtProject
|
Parsed DbtProject instance |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If file doesn't exist |
ValueError
|
If YAML is invalid or doesn't match schema |
Source code in src/brix/modules/dbt/project/models.py
to_yaml()
¶
Serialize project configuration to YAML string.
Returns:
| Type | Description |
|---|---|
str
|
YAML string representation |
Source code in src/brix/modules/dbt/project/models.py
HubPackage
¶
Bases: BaseModel
A package from the dbt Hub (hub.getdbt.com).
Example
- package: dbt-labs/dbt_utils version: ">=1.0.0"
Source code in src/brix/modules/dbt/project/models.py
validate_package_name(v)
classmethod
¶
Validate package name follows hub format.
GitPackage
¶
Bases: BaseModel
A package from a Git repository.
Example
- git: "https://github.com/org/repo.git" revision: main subdirectory: "path/to/dbt_project"
Source code in src/brix/modules/dbt/project/models.py
LocalPackage
¶
Bases: BaseModel
A package from the local filesystem.
Example
- local: ../shared_macros
Source code in src/brix/modules/dbt/project/models.py
DbtPackages
¶
Bases: BaseModel
Pydantic model for packages.yml configuration.
Represents the list of dbt packages to install.
Source code in src/brix/modules/dbt/project/models.py
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 | |
from_yaml(content)
classmethod
¶
Parse packages configuration from YAML string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
content
|
str
|
YAML string content of packages.yml |
required |
Returns:
| Type | Description |
|---|---|
DbtPackages
|
Parsed DbtPackages instance |
Raises:
| Type | Description |
|---|---|
ValueError
|
If YAML is invalid or doesn't match schema |
Source code in src/brix/modules/dbt/project/models.py
from_file(path)
classmethod
¶
Load packages configuration from a file path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
Path to packages.yml file |
required |
Returns:
| Type | Description |
|---|---|
DbtPackages
|
Parsed DbtPackages instance |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If file doesn't exist |
ValueError
|
If YAML is invalid or doesn't match schema |
Source code in src/brix/modules/dbt/project/models.py
to_yaml()
¶
Serialize packages configuration to YAML string.
Returns:
| Type | Description |
|---|---|
str
|
YAML string representation |
Source code in src/brix/modules/dbt/project/models.py
add_hub_package(package, version)
¶
Add a hub package to the list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
package
|
str
|
Package name (e.g., "dbt-labs/dbt_utils") |
required |
version
|
str
|
Version specifier (e.g., ">=1.0.0") |
required |
Source code in src/brix/modules/dbt/project/models.py
add_git_package(git, revision, subdirectory=None)
¶
Add a git package to the list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
git
|
str
|
Git repository URL |
required |
revision
|
str
|
Branch, tag, or commit hash |
required |
subdirectory
|
str | None
|
Optional subdirectory within repo |
None
|
Source code in src/brix/modules/dbt/project/models.py
add_local_package(local)
¶
Add a local package to the list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
local
|
str
|
Local filesystem path |
required |
validate_project_name(name)
¶
Validate a dbt project name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Project name to validate |
required |
Returns:
| Type | Description |
|---|---|
str
|
The validated project name |
Raises:
| Type | Description |
|---|---|
ProjectNameError
|
If name doesn't match dbt requirements |
Source code in src/brix/modules/dbt/project/models.py
validate_hub_package_name(name)
¶
Validate a dbt hub package name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Package name to validate (e.g., "dbt-labs/dbt_utils") |
required |
Returns:
| Type | Description |
|---|---|
str
|
The validated package name |
Raises:
| Type | Description |
|---|---|
PackageNameError
|
If name doesn't match hub package format |