[BUG](pyspark) Honor string min_length in base-row generation#578
Open
Seth Fitzsimmons (sethfitz) wants to merge 1 commit into
Open
[BUG](pyspark) Honor string min_length in base-row generation#578Seth Fitzsimmons (sethfitz) wants to merge 1 commit into
Seth Fitzsimmons (sethfitz) wants to merge 1 commit into
Conversation
_value_from_check_string_min_length ignored the descriptor's min_length and always returned a single character, so a string field with min_length > 1 would get a base/valid row value that already violates the constraint -- making the generated conformance ::valid row invalid and the ::invalid scenario's baseline wrong. Read the min_length bound from the descriptor and emit a filler of that length. Latent today (no live schema field declares string min_length > 1); surfaced while working the generalize-field-path branch (bd-swy2). Fixes bd-mwy8. Signed-off-by: Seth Fitzsimmons <seth@mojodna.net>
🗺️ Schema reference docs preview is live!
Note ♻️ This preview updates automatically with each push to this PR. |
Seth Fitzsimmons (sethfitz)
marked this pull request as draft
July 21, 2026 03:34
Seth Fitzsimmons (sethfitz)
marked this pull request as ready for review
July 21, 2026 04:16
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.
Summary
_value_from_check_string_min_length(base-row test-data synthesis) ignored the descriptor'smin_lengthand always returned a single character. For any string field withmin_length > 1, the synthesized base/valid row value ('a', length 1) already violates the constraint -- so the generated conformance::validrow would be invalid and the::invalidscenario's baseline wrong.The fix reads the
min_lengthbound from the descriptor and emits a filler of that length ('a' * min_length).Scope
Latent on
maintoday: no live schema field declares a stringmin_length > 1, so the conformance suite stays green and generated output is unchanged. The defect surfaced while working the generalize-field-path branch, where a mixed-shape test had to usemin_length=1rather than3to keep its valid row valid. Genuinely orthogonal to that branch -- it does not mask a defect in #570.The analogous array min-length synthesizer (
_min_length_from_shape_constraints) already readsmin_lengthcorrectly and generates that many elements; string max-length and array max-length are not lower bounds and need no base-row value. The string min-length synthesizer was the sole offender.Part of #517.