Commit 45aca33
fix: JsonItemsParser should yield floats, not Decimals
ijson.items() parses non-integer JSON numbers as decimal.Decimal by default, which the
CDK cannot serialize downstream (orjson raises 'Decimal is not JSON serializable'). This
broke any JsonItemsDecoder stream with decimal fields (e.g. Amazon Brand Analytics
clickShare/conversionShare, Sales & Traffic, Vendor reports).
Pass use_float=True so non-integer numbers are parsed as float, matching the
json.loads/orjson behavior of the other JSON parsers. Adds a regression test.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 8ee6423 commit 45aca33
2 files changed
Lines changed: 19 additions & 1 deletion
File tree
- airbyte_cdk/sources/declarative/decoders
- unit_tests/sources/declarative/decoders
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
153 | 155 | | |
154 | 156 | | |
155 | 157 | | |
| |||
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
454 | 470 | | |
455 | 471 | | |
456 | 472 | | |
| |||
0 commit comments