Commit 0b5cf79
committed
feat: add JsonItemsDecoder for streaming large JSON responses
Adds a new declarative decoder, JsonItemsDecoder, that streams elements
of a nested array out of a single JSON document one at a time using the
ijson library. This lets manifest-only connectors decode multi-GB JSON
responses (e.g. Amazon Seller Partner Brand Analytics reports) without
loading the full document into memory.
- New `JsonItemsParser` in composite_raw_decoder.py (wraps ijson.items)
- New `JsonItemsDecoder` schema entry, wired into GzipDecoder /
ZipfileDecoder / top-level decoder unions so it composes with the
existing decoder hierarchy
- Pydantic models regenerated from schema
- Factory: create_json_items_decoder + JsonItemsDecoderModel handling
in _get_parser
- Drop ijson from deptry DEP002 ignore list now that the CDK imports it
directly; update pyproject.toml comment to reflect first-class use
- Unit tests covering top-level, nested, empty, encoding, gzip
composition, missing path validation, and lazy streaming behavior1 parent 9852599 commit 0b5cf79
6 files changed
Lines changed: 415 additions & 156 deletions
File tree
- airbyte_cdk/sources/declarative
- decoders
- models
- parsers
- unit_tests/sources/declarative/decoders
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2628 | 2628 | | |
2629 | 2629 | | |
2630 | 2630 | | |
| 2631 | + | |
| 2632 | + | |
| 2633 | + | |
| 2634 | + | |
| 2635 | + | |
| 2636 | + | |
| 2637 | + | |
| 2638 | + | |
| 2639 | + | |
| 2640 | + | |
| 2641 | + | |
| 2642 | + | |
| 2643 | + | |
| 2644 | + | |
| 2645 | + | |
| 2646 | + | |
| 2647 | + | |
| 2648 | + | |
| 2649 | + | |
| 2650 | + | |
| 2651 | + | |
| 2652 | + | |
| 2653 | + | |
| 2654 | + | |
| 2655 | + | |
| 2656 | + | |
| 2657 | + | |
| 2658 | + | |
| 2659 | + | |
| 2660 | + | |
| 2661 | + | |
| 2662 | + | |
| 2663 | + | |
| 2664 | + | |
2631 | 2665 | | |
2632 | 2666 | | |
2633 | 2667 | | |
| |||
2869 | 2903 | | |
2870 | 2904 | | |
2871 | 2905 | | |
| 2906 | + | |
2872 | 2907 | | |
2873 | 2908 | | |
2874 | 2909 | | |
| |||
3909 | 3944 | | |
3910 | 3945 | | |
3911 | 3946 | | |
| 3947 | + | |
3912 | 3948 | | |
3913 | 3949 | | |
3914 | 3950 | | |
| |||
3997 | 4033 | | |
3998 | 4034 | | |
3999 | 4035 | | |
| 4036 | + | |
4000 | 4037 | | |
4001 | 4038 | | |
4002 | 4039 | | |
| |||
4163 | 4200 | | |
4164 | 4201 | | |
4165 | 4202 | | |
| 4203 | + | |
4166 | 4204 | | |
4167 | 4205 | | |
4168 | 4206 | | |
| |||
4175 | 4213 | | |
4176 | 4214 | | |
4177 | 4215 | | |
| 4216 | + | |
4178 | 4217 | | |
4179 | 4218 | | |
4180 | 4219 | | |
| |||
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
101 | 129 | | |
102 | 130 | | |
103 | 131 | | |
| |||
0 commit comments