fix(flow-php/etl): schema definition compatibility, matching and merging - #2589
Merged
Conversation
- isCompatible() fans out over union members instead of testing set equality - merge() returns the union when the other definition is one of its members - symmetric merge in the other 17 definitions, so Schema::merge() no longer depends on receiver order - extract UnionMembers to resolve a union's member definitions
- cast values whose type definition_from_type() rewrote - normalize ArrayType union members to json - document type_array() as a json declaration
… "any type"
- nullable now widens the accepted value domain by exactly {null}
- non-nullable definitions reject a null value
- NullDefinition matches only a null value
…ng entrie - UnionDefinition::memberFor() picks the member matching the value - native hydrator resolves union columns through it, per row - native cast now casts before resolving, matching PhpRowHydrator
- matches() validates the value, not just the type class - merge() widens to a common type instead of throwing - drop lossy date/datetime to integer and float widening - widen containers to json at element level too, matching columns - document flow-php-ext alongside arrow-ext in the Rust guide
This comment has been minimized.
This comment has been minimized.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 1.x #2589 +/- ##
============================================
+ Coverage 86.33% 86.40% +0.06%
- Complexity 23253 23819 +566
============================================
Files 1823 1826 +3
Lines 72026 72164 +138
============================================
+ Hits 62187 62353 +166
+ Misses 9839 9811 -28 🚀 New features to boost your workflow:
|
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.
Change Log
Added
flow-php/etl-UnionDefinition::memberFor()resolving a union member from a valueflow-php/etl-CommonTyperesolving a common type for incompatible definitionsflow-php/etl-UnionMembersandUnionTypeNormalizercollaboratorsFixed
flow-php/etl- union definitions accept and merge their own membersflow-php/etl- declaredarray<mixed>no longer breaks entry creationflow-php/etl-Definition::matches()respects nullabilityflow-php/etl-Definition::matches()compares type parametersflow-php/etl-Definition::merge()no longer throws on incompatible typesflow-php/etl- union columns build the correct entry per valueflow-php/flow-php-ext- native hydrator resolves union columns per rowChanged
flow-php/etl-array<mixed>inside a union projects tojsonflow-php/etl- incompatible containers widen tojsonat column and element levelflow-php/flow-php-ext- Rust contributing guide documents both extensionsRemoved
flow-php/etl- lossydate/datetimewidening tointegerandfloatDeprecated
Security