Skip to content

fix(flow-php/etl): schema definition compatibility, matching and merging - #2589

Merged
norberttech merged 5 commits into
1.xfrom
union-type-merge-bug
Aug 9, 2026
Merged

fix(flow-php/etl): schema definition compatibility, matching and merging#2589
norberttech merged 5 commits into
1.xfrom
union-type-merge-bug

Conversation

@norberttech

Copy link
Copy Markdown
Member

Change Log


Added

  • flow-php/etl - UnionDefinition::memberFor() resolving a union member from a value
  • flow-php/etl - CommonType resolving a common type for incompatible definitions
  • flow-php/etl - UnionMembers and UnionTypeNormalizer collaborators

Fixed

  • flow-php/etl - union definitions accept and merge their own members
  • flow-php/etl - declared array<mixed> no longer breaks entry creation
  • flow-php/etl - Definition::matches() respects nullability
  • flow-php/etl - Definition::matches() compares type parameters
  • flow-php/etl - Definition::merge() no longer throws on incompatible types
  • flow-php/etl - union columns build the correct entry per value
  • flow-php/flow-php-ext - native hydrator resolves union columns per row

Changed

  • flow-php/etl - array<mixed> inside a union projects to json
  • flow-php/etl - incompatible containers widen to json at column and element level
  • flow-php/flow-php-ext - Rust contributing guide documents both extensions

Removed

  • flow-php/etl - lossy date/datetime widening to integer and float

Deprecated

Security

- 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
@norberttech norberttech added this to the 0.43.0 milestone Aug 9, 2026
@datadog-official

This comment has been minimized.

@codecov

codecov Bot commented Aug 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.40%. Comparing base (68c0971) to head (4ee6f1f).
✅ All tests successful. No failed tests found.

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     
Components Coverage Δ
etl 91.17% <100.00%> (+0.29%) ⬆️
cli 89.40% <ø> (ø)
lib-array-dot 81.44% <ø> (ø)
lib-azure-sdk 64.44% <ø> (ø)
lib-doctrine-dbal-bulk 93.61% <ø> (ø)
lib-filesystem 86.67% <ø> (ø)
lib-types 91.85% <ø> (+0.12%) ⬆️
lib-parquet 70.23% <ø> (ø)
lib-parquet-viewer 82.26% <ø> (ø)
lib-snappy 89.38% <ø> (ø)
lib-dremel 0.00% <ø> (ø)
lib-postgresql 87.74% <ø> (ø)
lib-telemetry 86.64% <ø> (ø)
bridge-filesystem-async-aws 92.74% <ø> (ø)
bridge-filesystem-azure 90.45% <ø> (ø)
bridge-monolog-http 96.82% <ø> (ø)
bridge-monolog-telemetry 94.79% <ø> (ø)
bridge-openapi-specification 92.07% <ø> (ø)
symfony-http-foundation 78.57% <ø> (ø)
bridge-psr18-telemetry 100.00% <ø> (ø)
bridge-psr3-telemetry 98.95% <ø> (ø)
bridge-psr7-telemetry 100.00% <ø> (ø)
bridge-telemetry-otlp 90.11% <ø> (ø)
bridge-symfony-http-foundation-telemetry 92.85% <ø> (ø)
bridge-symfony-filesystem-bundle 91.85% <ø> (ø)
bridge-symfony-filesystem-cache 98.18% <ø> (ø)
bridge-symfony-postgresql-bundle 93.57% <ø> (ø)
bridge-symfony-postgresql-cache 94.41% <ø> (ø)
bridge-symfony-postgresql-messenger 98.80% <ø> (ø)
bridge-symfony-postgresql-session 93.65% <ø> (ø)
bridge-symfony-telemetry-bundle 90.72% <ø> (ø)
adapter-chartjs 84.05% <ø> (ø)
adapter-csv 89.46% <ø> (ø)
adapter-doctrine 90.75% <ø> (ø)
adapter-google-sheet 91.56% <ø> (ø)
adapter-http 75.79% <ø> (ø)
adapter-json 87.66% <ø> (ø)
adapter-logger 50.00% <ø> (ø)
adapter-parquet 88.85% <ø> (ø)
adapter-text 92.59% <ø> (ø)
adapter-xml 84.45% <ø> (ø)
adapter-avro 0.00% <ø> (ø)
adapter-excel 87.20% <ø> (ø)
adapter-postgresql 90.84% <ø> (ø)
adapter-seal 83.61% <ø> (ø)
bridge-phpunit-postgresql 75.30% <ø> (ø)
bridge-phpunit-telemetry 87.36% <ø> (ø)
bridge-phpstan-types 0.00% <ø> (ø)
bridge-postgresql-valinor 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@norberttech
norberttech merged commit 16447c2 into 1.x Aug 9, 2026
85 of 89 checks passed
@norberttech
norberttech deleted the union-type-merge-bug branch August 9, 2026 09:56
@github-project-automation github-project-automation Bot moved this from Todo to Done in Roadmap Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant