Skip to content

[BUG](pyspark) Honor string min_length in base-row generation#578

Open
Seth Fitzsimmons (sethfitz) wants to merge 1 commit into
pyspark-expression-codegenfrom
base-row-string-min-length
Open

[BUG](pyspark) Honor string min_length in base-row generation#578
Seth Fitzsimmons (sethfitz) wants to merge 1 commit into
pyspark-expression-codegenfrom
base-row-string-min-length

Conversation

@sethfitz

@sethfitz Seth Fitzsimmons (sethfitz) commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

_value_from_check_string_min_length (base-row test-data synthesis) ignored the descriptor's min_length and always returned a single character. For any string field with min_length > 1, the synthesized base/valid row value ('a', length 1) already violates the constraint -- so the generated conformance ::valid row would be invalid and the ::invalid scenario's baseline wrong.

The fix reads the min_length bound from the descriptor and emits a filler of that length ('a' * min_length).

Scope

Latent on main today: no live schema field declares a string min_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 use min_length=1 rather than 3 to 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 reads min_length correctly 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.

_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>
@github-actions

Copy link
Copy Markdown

🗺️ Schema reference docs preview is live!

🌍 Preview https://staging.overturemaps.org/schema/pr/578/schema/index.html
🕐 Updated Jul 21, 2026 03:32 UTC
📝 Commit 11690ca
🔧 env SCHEMA_PREVIEW true

Note

♻️ This preview updates automatically with each push to this PR.

@sethfitz
Seth Fitzsimmons (sethfitz) marked this pull request as draft July 21, 2026 03:34
@sethfitz
Seth Fitzsimmons (sethfitz) marked this pull request as ready for review July 21, 2026 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant