Skip to content

feat(flow-php/etl): corrupted records are refused or routed, never repaired silently - #2712

Merged
norberttech merged 1 commit into
1.xfrom
corrupted-records
Oct 31, 2026
Merged

norberttech merged 1 commit into
1.xfrom
corrupted-records

Conversation

@norberttech

Copy link
Copy Markdown
Member

Resolves: #xxx

Change Log


Added

  • flow-php/etl - CorruptedRecordException for a record that cannot become a row
  • flow-php/etl - withCorruptedRecords($loader) routes corrupted records to a loader (CorruptedRecordsRouter)
  • flow-php/etl-adapter-csv - withMissingColumnsAsNull() pads short records
  • flow-php/etl-adapter-excel - withMissingColumnsAsNull(), true by default
  • flow-php/etl-adapter-google-sheet - withMissingColumnsAsNull() pads short rows
  • flow-php/flow-php-ext - native CSV and JSON readers report corrupted records like the PHP readers

Fixed

  • flow-php/etl-adapter-csv - extra fields of a line are no longer dropped silently
  • flow-php/etl-adapter-excel - extra cells of a row are no longer dropped silently
  • flow-php/etl-adapter-json - a key first seen after the inference sample is a schema error, not dropped
  • flow-php/etl-adapter-csv - a declared column missing from the header is a schema error, not null

Changed

  • flow-php/etl - a value that does not cast to a declared schema is a corrupted record
  • flow-php/etl - a record past the inference sample throws InferredSchemaException with its offset and line
  • flow-php/etl - extract() may yield CorruptedRecordException beside Rows
  • flow-php/etl - to_date_time(null) returns null
  • flow-php/etl-adapter-csv - an empty line is skipped
  • flow-php/etl-adapter-json - JsonReadBytes renamed to JsonReadProgress

Removed

  • flow-php/etl-adapter-google-sheet - withDropExtraColumns()

Deprecated

Security

…paired silently

- readers refuse records that don't match the header or schema with CorruptedRecordException
- withCorruptedRecords($loader) routes them through the run's own loader lifecycle
- withMissingColumnsAsNull() replaces padding, truncation and Google Sheet withDropExtraColumns()
- schema errors for records or keys past the inference sample and missing declared columns
- Rust CSV and JSON readers match the PHP readers
- to_date_time(null) returns null; Corrupted Records documentation page
@codecov

codecov Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.90625% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.47%. Comparing base (216094b) to head (d52766d).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff              @@
##                1.x    #2712      +/-   ##
============================================
+ Coverage     90.18%   90.47%   +0.29%     
- Complexity      122    31012   +30890     
============================================
  Files          2175     2177       +2     
  Lines         89259    89673     +414     
============================================
+ Hits          80499    81134     +635     
+ Misses         8760     8539     -221     
Components Coverage Δ
etl 95.86% <99.70%> (+0.04%) ⬆️
cli 87.05% <ø> (ø)
lib-array-dot 96.52% <ø> (ø)
lib-azure-sdk 64.17% <ø> (+1.02%) ⬆️
lib-doctrine-dbal-bulk 94.24% <ø> (ø)
lib-filesystem 88.96% <ø> (+3.54%) ⬆️
lib-types 94.60% <ø> (ø)
lib-parquet 82.68% <ø> (ø)
lib-parquet-viewer 83.15% <ø> (ø)
lib-snappy 89.42% <ø> (-0.45%) ⬇️
lib-dremel 0.00% <ø> (ø)
lib-postgresql 89.44% <ø> (ø)
lib-telemetry 86.85% <ø> (ø)
bridge-filesystem-async-aws 96.12% <ø> (+12.17%) ⬆️
bridge-filesystem-azure 94.39% <ø> (+13.90%) ⬆️
bridge-filesystem-sftp 90.29% <ø> (+4.85%) ⬆️
bridge-monolog-http 96.84% <ø> (ø)
bridge-monolog-telemetry 94.79% <ø> (ø)
bridge-openapi-specification 91.95% <ø> (ø)
symfony-http-foundation 80.76% <ø> (ø)
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 90.72% <ø> (ø)
bridge-symfony-filesystem-cache 98.18% <ø> (ø)
bridge-symfony-postgresql-bundle 93.35% <ø> (ø)
bridge-symfony-postgresql-cache 94.41% <ø> (ø)
bridge-symfony-postgresql-messenger 98.80% <ø> (ø)
bridge-symfony-postgresql-session 93.65% <ø> (ø)
bridge-symfony-telemetry-bundle 90.77% <ø> (ø)
adapter-chartjs 82.11% <ø> (ø)
adapter-csv 97.67% <98.88%> (+0.05%) ⬆️
adapter-doctrine 95.13% <ø> (ø)
adapter-google-sheet 97.51% <100.00%> (+0.11%) ⬆️
adapter-http 87.18% <ø> (ø)
adapter-json 90.21% <100.00%> (-0.10%) ⬇️
adapter-logger 47.05% <ø> (ø)
adapter-parquet 96.28% <ø> (ø)
adapter-text 97.70% <ø> (ø)
adapter-xml 98.01% <ø> (ø)
adapter-avro 6.25% <ø> (ø)
adapter-excel 96.75% <94.18%> (-0.37%) ⬇️
adapter-postgresql 97.34% <ø> (ø)
adapter-seal 89.91% <ø> (ø)
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 9d1c97a into 1.x Oct 31, 2026
26 checks passed
@norberttech
norberttech deleted the corrupted-records branch October 31, 2026 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant