-
Notifications
You must be signed in to change notification settings - Fork 123
test: Add array tests to schema diffing (4/5) #1480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
murali-db
wants to merge
7
commits into
delta-io:main
Choose a base branch
from
murali-db:murali-db/schema-diff-pr4
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
Introduces core data structures for schema diffing: - SchemaDiff, FieldChange, FieldUpdate types - FieldChangeType enum for classifying changes - SchemaDiffError for validation errors - ColumnName::parent() helper method This is part 1/5 of the schema diffing feature implementation. The actual diffing algorithm will be added in PR 2. Note: This PR includes a temporary stub for compute_schema_diff() to allow basic tests to compile. The full implementation from the original PR delta-io#1346 will be copied exactly in PR 2. Related to delta-io#1346
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1480 +/- ##
==========================================
+ Coverage 84.84% 85.35% +0.51%
==========================================
Files 120 121 +1
Lines 32103 33490 +1387
Branches 32103 33490 +1387
==========================================
+ Hits 27238 28587 +1349
- Misses 3542 3573 +31
- Partials 1323 1330 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Adds a comprehensive unit test that exercises the filtering logic by manually constructing a SchemaDiff with both top-level and nested field changes. This test verifies that the methods correctly filter fields by path depth (length 1 vs length > 1). The test improves code coverage for these methods from 0% to full coverage of the filtering logic, addressing CI coverage requirements.
Adds complete diffing functionality for non-nested schemas: - Field collection and ID-based matching - Detection of adds, removes, renames, nullability changes - Physical name validation for column mapping - Breaking change classification - Full type classification including arrays and maps - Ancestor filtering for LCA reporting Currently supports flat schemas (top-level fields only). The collect_all_fields_with_paths() function has a commented-out recursive call that will be enabled in PR 3 to support nested fields. All other functions are copied exactly from the original PR delta-io#1346 (murali-db/schema-evol) with no logic changes. This is part 2/5 of the schema diffing feature implementation. Tests included (9 tests): - test_identical_schemas - test_change_count - test_top_level_added_field - test_added_required_field_is_breaking - test_added_nullable_field_is_not_breaking - test_physical_name_validation - test_multiple_change_types - test_multiple_with_breaking_change - test_duplicate_field_id_error Related to delta-io#1346
Adds a comprehensive unit test that exercises the filtering logic by manually constructing a SchemaDiff with both top-level and nested field changes. This test verifies that the methods correctly filter fields by path depth (length 1 vs length > 1). The test improves code coverage for these methods from 0% to full coverage of the filtering logic, addressing CI coverage requirements.
Extends schema diffing to handle nested structures: - Recursive field collection through struct hierarchies - Ancestor filtering to report only LCA changes - Type change classification for struct containers - Support for arbitrarily deep nesting Arrays and maps support coming in follow-up PRs. This is part 3/5 of the schema diffing feature implementation. Related to delta-io#1346 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Adds a comprehensive unit test that exercises the filtering logic by manually constructing a SchemaDiff with both top-level and nested field changes. This test verifies that the methods correctly filter fields by path depth (length 1 vs length > 1). The test improves code coverage for these methods from 0% to full coverage of the filtering logic, addressing CI coverage requirements.
Adds 8 comprehensive array tests: - Array element struct field changes - Doubly nested array type changes - Nested array nullability (loosened/tightened) - Inner array nullability (loosened/tightened) - Simple array nullability (loosened/tightened) All array implementation code was already present from PR 2. This PR only adds tests to verify array functionality. This is part 4/5 of the schema diffing feature implementation. Related to delta-io#1346 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
2e5ff09 to
fa43ac0
Compare
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.
This is part 4 of 5 PRs that implement schema diffing for Delta Kernel Rust.
What's in this PR
Array tests covering:
array<array<int>>→array<array<string>>)Key Point
This PR is test-only. The array implementation (in
classify_data_type_changeandcollect_fields_from_datatype) was already included in PR 2.What's NOT in this PR
Feature Gating
Inherits feature gate from PR #1477. Gate will be removed in PR 5.
Part of #1346