Add support for attribute renaming/deletion in the schema conversion #1858
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 pull request introduces a new post-processing step to the schema conversion logic in the converter registry, ensuring that attribute renaming and deletion are handled explicitly after all field-type conversions. The main change is the addition of the
AttributeRemapperConverter, which is used internally to finalize attribute names and drop unused attributes, improving the correctness and flexibility of schema conversions. The conversion path finding logic and related tests have been updated to reflect this new step, and some minor improvements were made to the converter implementation details.Converter registry and path finding improvements
AttributeRemapperConverter, a special converter that performs attribute renaming and selection (dropping others) as a post-processing step after field-type conversions. This converter is not registered globally but is used internally by the conversion path finder.AttributeRemapperConverterwhen attribute names or the set of attributes do not match the target schema, ensuring that the output schema is correct. [1] [2]_SchemaStateequality and hashing to ignore attribute names, focusing only on field types and their properties, since renaming is now handled in post-processing._get_applicable_convertersto simplify the logic and ensure uniqueness of temporary names during conversion steps. [1] [2]Converter implementation details
Testing updates
AttributeRemapperConverterto the test imports and updated all relevant tests to expect an additional converter in the conversion path, verifying that attribute remapping is performed as a final step. [1] [2] [3] [4] [5] [6] [7] [8] [9]Summary
How to test
Checklist
License
Feel free to contact the maintainers if that's a concern.