Repository navigation
Add an optional pre-run check to Checkpoints #12210
Replies: 2 comments
|
Hi @GilShaulShay, thanks for the question, this is an interesting use case.
There isn't, and my instinct that your orchestrator is likely better suited to perform pre-validation readiness checks than GX is, particularly if you're calling an API. Beyond the general question of library scope, Checkpoints need to be serializable, so I'm not sure it's feasible to add a pre-validation hook as a Python callable. On the other hand, if you're checking state of a load-tracking table, we could reframe this as a data quality question. The pattern would be to set up a table asset and batch definition for your load-tracking table using the same grain partitioner that you use for the primary Checkpoint (e.g. Does that work for your use case? If not, I'm curious to better understand why GX would be better suited to own the pre-flight checks than your orchestrator pipeline. Hope that helps! |
|
Thanks, that helps. Checking the load-tracking table with GX makes sense for this case, and I see your point about serialization. |
Uh oh!
There was an error while loading. Please reload this page.
Hi! I’m building a prototype that runs the same GX checks against a database under normal and disrupted conditions.
One situation I’m testing is validation starting while a data load is still running. GX correctly reports missing rows, but I’d like to distinguish an incomplete load from a completed dataset that fails validation.
I looked at Checkpoint Actions, but those run after validation. Is there a supported way to plug in a check before validation starts?
If not, would you consider an optional pre-validation hook? Users would provide a Python function that checks readiness, for example by querying a load-tracking table or calling an upstream API. For a load-complete marker, the check would need to confirm it belongs to the batch being validated, not a previous load.
If the function reports “not ready” or cannot determine readiness, GX wouldn’t start validation. It would return a “not run”(or aborted) outcome with the reason, so the pipeline could decide whether to retry later or stop. Otherwise, the same GX checks would run unchanged, and any data-quality failures would still be reported as failures.
I can put this logic before checkpoint.run() in my own code. What I’m suggesting is a standard place to attach it and a standard way to report that validation didn’t run, without treating it as a pass or a failure.
All reactions