Repository navigation
Conversation
Remove only Filter sentinels from nested lists and dictionaries so valid JSON null values survive post-processing. Add sentinel regression cases and public Guard/AsyncGuard parse coverage.
|
@longfie is attempting to deploy a commit to the Guardrails AI Team on Vercel. A member of the Team first needs to authorize it. |
This was referenced Nov 13, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
apply_filtersremoves list items and dictionary fields whenever their recursively processed value isNone. That conflates theFiltersentinel with legitimate JSONnull, even when no filter validator is configured.For example, a Pydantic output schema with a required nullable
noteand nullable list elements accepts:{"note": null, "values": [1, null, 2]}Both
Guard.parseandAsyncGuard.parsecurrently reportvalidation_passed=Truebut return{"values": [1, 2]}. The result loses a required field, changes list positions, and no longer validates against the original schema.Changes
Filterinstance before omitting it.Nonevalues, including in nested containers.Filtersentinels and the existing top-levelFilter()→Nonebehavior.None/Filterunit cases and public API regressions forGuardwith bothGUARDRAILS_RUN_SYNCsettings and forAsyncGuard.Validation
All tests below used local, mocked providers; no model API calls were needed.
pytest tests/unit_tests/actions/test_filter.py tests/integration_tests/test_nullable_output.py -qpytest tests/ -qcomparison:main(06d0ff2): 865 passed, 54 skipped, 4 failed.TestTelemetryspan-count tests andTestConfigureExtended::test_configure_with_both_parameters.ruff check guardrails/ tests/andruff format guardrails/ tests/ --check: passed.pyright guardrails/actions/filter.py: 0 errors, 0 warnings.pyright guardrails/: the same 17 existing errors on both revisions (optional integration imports and existing type errors); normalized diagnostic output is identical.git diff --check: passed.AI assistance was used for implementation, regression tests, and verification. The results above were produced by running the reported checks, and the patch received an independent code review.