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 | |
DocsColumnConfig ¶
Bases: BaseModel
Column-level docs surfaced in generated documentation.
Source code in src/fastflowtransform/config/project.py
135 136 137 138 139 140 | |
DocsModelConfig ¶
Bases: BaseModel
Model-level docs surfaced in generated documentation.
Source code in src/fastflowtransform/config/project.py
143 144 145 146 147 148 149 150 | |
DocsConfig ¶
Bases: BaseModel
Optional documentation-related configuration.
Example:
docs
dag_dir: "site/dag" include_rendered_sql: true models: users: description: "Raw users table" columns: id: "Primary key"
Source code in src/fastflowtransform/config/project.py
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | |
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
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | |
HooksConfig ¶
Bases: BaseModel
Top-level hooks section in project.yml.
Source code in src/fastflowtransform/config/project.py
216 217 218 219 220 221 222 223 224 225 226 227 228 | |
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
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | |
NotNullTestConfig ¶
Bases: BaseProjectTestConfig
not_null test: assert that a column contains no NULL values.
Source code in src/fastflowtransform/config/project.py
258 259 260 261 262 263 264 265 266 267 268 269 270 | |
UniqueTestConfig ¶
Bases: BaseProjectTestConfig
unique test: detect duplicate values within a column.
Source code in src/fastflowtransform/config/project.py
273 274 275 276 277 278 279 280 281 282 283 | |
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
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 | |
GreaterEqualTestConfig ¶
Bases: BaseProjectTestConfig
greater_equal test: require all values to be >= threshold.
Source code in src/fastflowtransform/config/project.py
305 306 307 308 309 310 311 312 313 314 315 | |
NonNegativeSumTestConfig ¶
Bases: BaseProjectTestConfig
non_negative_sum test: validate that SUM(column) is not negative.
Source code in src/fastflowtransform/config/project.py
318 319 320 321 322 323 324 325 326 | |
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
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 | |
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
344 345 346 347 348 349 350 351 352 353 354 | |
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
357 358 359 360 361 362 363 364 365 366 367 368 | |
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
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 | |
ReconcileKeySide ¶
Bases: BaseModel
Key-based reconciliation side for coverage checks:
source/target: table: str key: str
Source code in src/fastflowtransform/config/project.py
388 389 390 391 392 393 394 395 396 397 398 399 400 | |
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
403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 | |
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
436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 | |
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
466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 | |
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
493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 | |
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
523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 | |
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
562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 | |
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
613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 | |