fastflowtransform.testing¶
TestFailure ¶
Bases: Exception
Raised when a data-quality check fails.
Source code in src/fastflowtransform/testing.py
157 158 159 160 161 162 | |
accepted_values ¶
accepted_values(con, table, column, *, values, where=None)
Checks that all non-NULL values of table.column are in the set 'values'.
Source code in src/fastflowtransform/testing.py
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | |
not_null ¶
not_null(con, table, column, where=None)
Fails if any non-filtered row has NULL in column.
Source code in src/fastflowtransform/testing.py
180 181 182 183 184 185 186 187 188 189 190 191 192 | |
unique ¶
unique(con, table, column, where=None)
Fails if any duplicate appears in column within the (optionally) filtered set.
Source code in src/fastflowtransform/testing.py
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 | |
reconcile_equal ¶
reconcile_equal(con, left, right, abs_tolerance=None, rel_tolerance_pct=None)
Assert left == right within absolute and/or relative tolerances.
Both sides are dictionaries: {"table": str, "expr": str, "where": Optional[str]}. If both tolerances are omitted, exact equality is enforced.
Source code in src/fastflowtransform/testing.py
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 | |
reconcile_ratio_within ¶
reconcile_ratio_within(con, left, right, min_ratio, max_ratio)
Assert min_ratio <= (left/right) <= max_ratio.
Source code in src/fastflowtransform/testing.py
300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 | |
reconcile_diff_within ¶
reconcile_diff_within(con, left, right, max_abs_diff)
Assert |left - right| <= max_abs_diff.
Source code in src/fastflowtransform/testing.py
317 318 319 320 321 322 323 324 325 | |
reconcile_coverage ¶
reconcile_coverage(con, source, target, source_where=None, target_where=None)
Assert that every key from source exists in target (anti-join count == 0).
Source code in src/fastflowtransform/testing.py
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 | |