Repository navigation
fix: ignore_column_order also sorts the fields of nested structs - #200
Merged
SemyonSinchenko merged 1 commit intoOct 19, 2026
Merged
SemyonSinchenko merged 1 commit into
SemyonSinchenko merged 1 commit into
Conversation
ignore_column_order only sorted the top level columns, so two DataFrames whose struct columns listed their fields in a different order still raised a SchemasNotEqualError. Sort the fields of every struct in the schema, including structs inside arrays and maps, before comparing.
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.
PR Checklist
docsis updatedDescription of changes
Fixes #146.
ignore_column_order=Trueonly sorted the top level columns. Two DataFrames whose struct columns listed their fields in a different order, for examplearray<struct<updated_at, id>>againstarray<struct<id, updated_at>>, still raised aSchemasNotEqualError.This sorts the fields of every struct in the schema before comparing, including structs inside arrays and maps (map keys and values). It applies to
assert_df_equalityandassert_approx_df_equality. Null structs stay null, and columns without structs are left as they are. The default (ignore_column_order=False) is unchanged, and the README notes the behavior.Tests cover nested structs, structs in arrays, map values and map keys, null structs, columns with no structs, the approx variant, that different values still fail, and that the default still fails on a different field order.