docs(data-quality): add check_output_custom section (#212) - #1658
docs(data-quality): add check_output_custom section (#212)#1658philipljh wants to merge 2 commits into
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Hello, made my first oss pr, open to any feedback and guidance. Cheers~ |
jernejfrank
left a comment
There was a problem hiding this comment.
Hey, nice work and welcome!
So I checked the underlying code and it turns out we have a bug there. Let me know if you are up for it to fixing it, otherwise I can also do it and we can merge your PR on top?
FYI:
, here we just return the full list ignoring theapplies_to method. This would need to be fixed to actually check whether the validator can be applied to the output and maybe add a test or two.
|
|
||
| The pieces are: | ||
|
|
||
| * ``applies_to`` -- whether this validator can run on the output type of the decorated function. |
There was a problem hiding this comment.
So turns out this actually does not fire on the custom validator route.
Feel free to do a fix! |
Cool, opened #1688 and will merge yours afterwards 👍 |
Closes #212 - adds documentation for
@check_output_customIt walks through the full lifecycle of a custom validator:
@check_output_customrelative to@check_output's default validators (data type, range, allowed values, ...), with a cross-reference to thecheck_outputAPI reference.AllPositiveValidator, that subclasseshamilton.data_quality.base.DataValidatorand checks a pandas Series for negative values. Each required method is then explained individually:applies_to,description,name,validatereturning aValidationResult(withpasses,message, and the free-formdiagnosticsdict), plus theimportanceconstructor argument.@check_output_customdecorators is not supported.importance="warn"logs through the standardloggingmodule and continues;importance="fail"raisesDataValidationError, with all validators evaluated first so every failure is reported at once.{name}_raw/ per-validator / final-node split, thehamilton.data_quality.contains_dq_resultsandhamilton.data_quality.source_nodetags, and a driver example showing that validator nodes can simply be requested as outputs to inspect theirValidationResult.Changes
Adds a "Custom validators" section to the "Data quality" how-to page (
docs/how-tos/run-data-quality-checks.rst) covering:@check_output's built-in validatorsDataValidatorsubclass example@check_output_custom(and that decorators can't be stacked)importance="warn"(logs, continues) vs"fail"(raisesDataValidationError)How I tested this
sphinx-build -b dirhtml -W; no warnings from the changed page.Notes
Checklist