fastflowtransform.config.project¶
IncrementalModelConfig ¶
Bases: BaseModel
Per-model incremental overlay from project.yml, for example:
models:
incremental:
fct_events_sql_inline:
incremental: true
unique_key: ["event_id"]
updated_at: "updated_at"
delta_sql: |
select ...
schema_sync: append_new_columns
fct_events_py_incremental:
incremental:
enabled: true
strategy: merge
unique_key: ["event_id"]
updated_at_column: "updated_at"
This is intentionally compatible with the fields on ModelConfig.
Source code in src/fastflowtransform/config/project.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 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 | |
ModelsBlock ¶
Bases: BaseModel
project.yml:
models:
storage:
users:
path: ".local/spark/users"
format: parquet
...
incremental:
my_model:
incremental: true
unique_key: ["id"]
updated_at: "updated_at"
Source code in src/fastflowtransform/config/project.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | |
SeedsBlock ¶
Bases: BaseModel
project.yml:
seeds:
storage:
seed_users:
path: ".local/spark/seed_users"
format: parquet
Source code in src/fastflowtransform/config/project.py
114 115 116 117 118 119 120 121 122 123 124 125 126 127 | |
DocsConfig ¶
Bases: BaseModel
Optional documentation-related configuration.
Example:
docs
dag_dir: "site/dag"
Source code in src/fastflowtransform/config/project.py
135 136 137 138 139 140 141 142 143 144 145 146 147 | |
HookSpec ¶
Bases: BaseModel
One hook entry from project.yml -> hooks.* lists. Example: - name: audit_run_start kind: sql sql: "insert into ..."
- name: python_banner kind: python callable: "hooks_demo.hooks.notify:on_run_start" select: "tag:example:hooks_demo"
Source code in src/fastflowtransform/config/project.py
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | |
HooksConfig ¶
Bases: BaseModel
Top-level hooks section in project.yml.
Source code in src/fastflowtransform/config/project.py
190 191 192 193 194 195 196 197 198 199 200 201 202 | |
BaseProjectTestConfig ¶
Bases: BaseModel
Common fields for all project-level tests declared in project.yml under tests:.
NOTE
- For table/column-level tests (not_null, unique, ...),
tableand/orcolumnare required in the concrete subclasses. - For reconciliation tests,
tableandcolumnare optional and used only for display/grouping in summaries.
Source code in src/fastflowtransform/config/project.py
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 | |
NotNullTestConfig ¶
Bases: BaseProjectTestConfig
not_null test: assert that a column contains no NULL values.
Source code in src/fastflowtransform/config/project.py
232 233 234 235 236 237 238 239 240 241 242 243 244 | |
UniqueTestConfig ¶
Bases: BaseProjectTestConfig
unique test: detect duplicate values within a column.
Source code in src/fastflowtransform/config/project.py
247 248 249 250 251 252 253 254 255 256 257 | |
AcceptedValuesTestConfig ¶
Bases: BaseProjectTestConfig
accepted_values test: ensure all non-NULL values are inside an allowed set.
Behaviour
- If
valuesis None or an empty list, the test is treated as a no-op (always passes), but still appears in summaries.
Source code in src/fastflowtransform/config/project.py
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 | |
GreaterEqualTestConfig ¶
Bases: BaseProjectTestConfig
greater_equal test: require all values to be >= threshold.
Source code in src/fastflowtransform/config/project.py
279 280 281 282 283 284 285 286 287 288 289 | |
NonNegativeSumTestConfig ¶
Bases: BaseProjectTestConfig
non_negative_sum test: validate that SUM(column) is not negative.
Source code in src/fastflowtransform/config/project.py
292 293 294 295 296 297 298 299 300 | |
RowCountBetweenTestConfig ¶
Bases: BaseProjectTestConfig
row_count_between test: ensure row count is between [min_rows, max_rows].
min_rowsdefaults to 1.max_rowsis optional (open-ended upper bound).
Source code in src/fastflowtransform/config/project.py
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 | |
validate_bounds ¶
validate_bounds()
Ensure that min_rows is less than or equal to max_rows when both are set.
Source code in src/fastflowtransform/config/project.py
318 319 320 321 322 323 324 325 326 327 328 | |
FreshnessTestConfig ¶
Bases: BaseProjectTestConfig
freshness test: warn or fail when latest timestamp is older
than max_delay_minutes.
Source code in src/fastflowtransform/config/project.py
331 332 333 334 335 336 337 338 339 340 341 342 | |
ReconcileExprSide ¶
Bases: BaseModel
Expression-based reconciliation side (left/right):
left/right: table: str expr: str where: optional filter condition
Source code in src/fastflowtransform/config/project.py
345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
ReconcileKeySide ¶
Bases: BaseModel
Key-based reconciliation side for coverage checks:
source/target: table: str key: str
Source code in src/fastflowtransform/config/project.py
362 363 364 365 366 367 368 369 370 371 372 373 374 | |
ReconcileEqualTestConfig ¶
Bases: BaseProjectTestConfig
reconcile_equal test: compare two scalar expressions with optional tolerances.
Attributes:
| Name | Type | Description |
|---|---|---|
left |
ReconcileExprSide
|
Left-hand expression ( |
right |
ReconcileExprSide
|
Right-hand expression. |
abs_tolerance |
float | None
|
Maximum absolute difference allowed. |
rel_tolerance_pct |
float | None
|
Maximum relative difference (percent). |
Notes
The top-level table/column fields are optional and only used for display in summaries.
Example (YAML):
- type: reconcile_equal
left: { table: a_tbl, expr: "sum(x)" }
right: { table: b_tbl, expr: "sum(y)", where: "dt >= current_date - interval '7 days'" }
abs_tolerance: 0.01
rel_tolerance_pct: 1.0
Source code in src/fastflowtransform/config/project.py
377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 | |
ReconcileRatioWithinTestConfig ¶
Bases: BaseProjectTestConfig
reconcile_ratio_within test: constrain the ratio left/right within [min_ratio, max_ratio].
Attributes:
| Name | Type | Description |
|---|---|---|
left |
ReconcileExprSide
|
Left-hand expression. |
right |
ReconcileExprSide
|
Right-hand expression. |
min_ratio |
float
|
Minimum allowed ratio. |
max_ratio |
float
|
Maximum allowed ratio. |
Example (YAML):
- type: reconcile_ratio_within
left: { table: orders, expr: "sum(amount)" }
right: { table: payments, expr: "sum(value)" }
min_ratio: 0.98
max_ratio: 1.02
Source code in src/fastflowtransform/config/project.py
410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 | |
ReconcileDiffWithinTestConfig ¶
Bases: BaseProjectTestConfig
reconcile_diff_within test: limit the absolute difference between two aggregates.
Attributes:
| Name | Type | Description |
|---|---|---|
left |
ReconcileExprSide
|
Left-hand expression. |
right |
ReconcileExprSide
|
Right-hand expression. |
max_abs_diff |
float
|
Maximum allowed absolute difference. |
Example (YAML):
- type: reconcile_diff_within
left: { table: a, expr: "count(*)" }
right: { table: b, expr: "count(*)" }
max_abs_diff: 10
Source code in src/fastflowtransform/config/project.py
440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 | |
ReconcileCoverageTestConfig ¶
Bases: BaseProjectTestConfig
reconcile_coverage test: ensure all keys from source exist in target.
Attributes:
| Name | Type | Description |
|---|---|---|
source |
ReconcileKeySide
|
Source side ( |
target |
ReconcileKeySide
|
Target side ( |
source_where |
str | None
|
Optional filter predicate applied to the source. |
target_where |
str | None
|
Optional filter predicate applied to the target. |
Example (YAML):
- type: reconcile_coverage
source: { table: crm_users, key: "user_id" }
target: { table: fact_orders, key: "user_id" }
source_where: "status = 'active'"
target_where: "dt >= current_date - interval '30 days'"
Source code in src/fastflowtransform/config/project.py
467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 | |
CustomProjectTestConfig ¶
Bases: BaseProjectTestConfig
Catch-all config for user-defined tests declared in project.yml under tests:.
type: any non-empty string (must NOT match a built-in test type if you want this class to be used; built-ins still win first).table/column: optional; for tests that don't need them, you can omit.- Extra keys are allowed and preserved (e.g. threshold, pattern, window_days).
Source code in src/fastflowtransform/config/project.py
497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 | |
ProjectConfig ¶
Bases: BaseModel
Strict representation of project.yml.
Example:
name: duckdb_api_demo
version: "0.1"
vars: {}
models:
storage: { ... }
incremental: { ... }
seeds:
storage: { ... }
tests:
- type: not_null
table: mart_users_join
column: user_id
tags: [batch]
Source code in src/fastflowtransform/config/project.py
536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 | |
parse_project_yaml_config ¶
parse_project_yaml_config(project_dir)
Read project.yml under project_dir and validate it strictly using Pydantic.
Typical usage inside core._load_project_yaml:
from fastflowtransform.config.project import parse_project_yaml_config
proj_cfg = parse_project_yaml_config(project_dir)
self.project_vars = dict(proj_cfg.vars or {})
# models.storage → storage.set_model_storage(...)
# seeds.storage → storage.set_seed_storage(...)
# models.incremental → self.incremental_models = ...
Source code in src/fastflowtransform/config/project.py
587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 | |