Fix spurious failure in convert_batches test helper #16627
Merged
+36
−120
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.
Which issue does this PR close?
nullable: trueif any of the branches produces fields withnullable: trueon the same position #15394Projection#15242 (comment)Rationale for this change
When query involves e.g. UNION ALL, it may produces record batches with incompatible schema. For example, one union branch may produce a nullable field while the order may produce a non-null field. Before the change,
convert_batchessuccess or failure depended on ordering of record batches returned by the query, and thus could lead (and did lead) to test flakiness.What changes are included in this PR?
This changes schema source used by the
convert_batches. Instead of peaking the first schema, it used the declared schema from the data frame, which should be correct with respect to nullability.Are these changes tested?
yes
Are there any user-facing changes?
no