Commit ffdb021
feat: add JsonItemsDecoder and always_decompress for streaming large gzipped JSON
Adds a streaming JSON decoder for very large single-document JSON responses, plus an
option to force gzip decompression when responses are mislabeled.
- JsonItemsParser/JsonItemsDecoder: stream-yield each element of a nested array via
ijson, so peak memory is bounded by one record instead of the full document.
Composes with the existing CompositeRawDecoder hierarchy (gzip/zip). Adds ijson as
a first-class CDK dependency.
- GzipDecoder.always_decompress: opt-in flag to always gzip-decompress the body
regardless of Content-Encoding/Content-Type. Needed for APIs that return gzip
bodies labeled 'Content-Encoding: identity' (e.g. Amazon Seller Partner reports),
where header-based selection would otherwise skip decompression.
Supersedes #1026 (adopts its JsonItemsDecoder work).
Co-Authored-By: devin-ai-integration[bot] <devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 09cc18f commit ffdb021
7 files changed
Lines changed: 691 additions & 282 deletions
File tree
- airbyte_cdk/sources/declarative
- decoders
- models
- parsers
- unit_tests/sources/declarative/decoders
Lines changed: 50 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2643 | 2643 | | |
2644 | 2644 | | |
2645 | 2645 | | |
| 2646 | + | |
| 2647 | + | |
| 2648 | + | |
| 2649 | + | |
| 2650 | + | |
| 2651 | + | |
| 2652 | + | |
| 2653 | + | |
| 2654 | + | |
| 2655 | + | |
| 2656 | + | |
| 2657 | + | |
| 2658 | + | |
| 2659 | + | |
| 2660 | + | |
| 2661 | + | |
| 2662 | + | |
| 2663 | + | |
| 2664 | + | |
| 2665 | + | |
| 2666 | + | |
| 2667 | + | |
| 2668 | + | |
| 2669 | + | |
| 2670 | + | |
| 2671 | + | |
| 2672 | + | |
| 2673 | + | |
| 2674 | + | |
| 2675 | + | |
| 2676 | + | |
| 2677 | + | |
| 2678 | + | |
| 2679 | + | |
2646 | 2680 | | |
2647 | 2681 | | |
2648 | 2682 | | |
| |||
2884 | 2918 | | |
2885 | 2919 | | |
2886 | 2920 | | |
| 2921 | + | |
2887 | 2922 | | |
2888 | 2923 | | |
2889 | 2924 | | |
| |||
3924 | 3959 | | |
3925 | 3960 | | |
3926 | 3961 | | |
| 3962 | + | |
3927 | 3963 | | |
3928 | 3964 | | |
3929 | 3965 | | |
| |||
4007 | 4043 | | |
4008 | 4044 | | |
4009 | 4045 | | |
| 4046 | + | |
| 4047 | + | |
| 4048 | + | |
| 4049 | + | |
| 4050 | + | |
| 4051 | + | |
| 4052 | + | |
| 4053 | + | |
| 4054 | + | |
| 4055 | + | |
| 4056 | + | |
4010 | 4057 | | |
4011 | 4058 | | |
4012 | 4059 | | |
4013 | 4060 | | |
4014 | 4061 | | |
| 4062 | + | |
4015 | 4063 | | |
4016 | 4064 | | |
4017 | 4065 | | |
| |||
4178 | 4226 | | |
4179 | 4227 | | |
4180 | 4228 | | |
| 4229 | + | |
4181 | 4230 | | |
4182 | 4231 | | |
4183 | 4232 | | |
| |||
4190 | 4239 | | |
4191 | 4240 | | |
4192 | 4241 | | |
| 4242 | + | |
4193 | 4243 | | |
4194 | 4244 | | |
4195 | 4245 | | |
| |||
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 | | |
| |||
Lines changed: 31 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
674 | 674 | | |
675 | 675 | | |
676 | 676 | | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
677 | 691 | | |
678 | 692 | | |
679 | 693 | | |
| |||
2195 | 2209 | | |
2196 | 2210 | | |
2197 | 2211 | | |
2198 | | - | |
| 2212 | + | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
| 2217 | + | |
| 2218 | + | |
| 2219 | + | |
| 2220 | + | |
| 2221 | + | |
| 2222 | + | |
| 2223 | + | |
| 2224 | + | |
2199 | 2225 | | |
2200 | 2226 | | |
2201 | 2227 | | |
| |||
2333 | 2359 | | |
2334 | 2360 | | |
2335 | 2361 | | |
2336 | | - | |
| 2362 | + | |
2337 | 2363 | | |
2338 | 2364 | | |
2339 | 2365 | | |
| |||
3005 | 3031 | | |
3006 | 3032 | | |
3007 | 3033 | | |
| 3034 | + | |
3008 | 3035 | | |
3009 | 3036 | | |
3010 | 3037 | | |
| |||
3138 | 3165 | | |
3139 | 3166 | | |
3140 | 3167 | | |
| 3168 | + | |
3141 | 3169 | | |
3142 | 3170 | | |
3143 | 3171 | | |
| |||
3154 | 3182 | | |
3155 | 3183 | | |
3156 | 3184 | | |
| 3185 | + | |
3157 | 3186 | | |
3158 | 3187 | | |
3159 | 3188 | | |
| |||
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
100 | 101 | | |
101 | 102 | | |
102 | 103 | | |
| |||
321 | 322 | | |
322 | 323 | | |
323 | 324 | | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
324 | 328 | | |
325 | 329 | | |
326 | 330 | | |
| |||
763 | 767 | | |
764 | 768 | | |
765 | 769 | | |
| 770 | + | |
766 | 771 | | |
767 | 772 | | |
768 | 773 | | |
| |||
2671 | 2676 | | |
2672 | 2677 | | |
2673 | 2678 | | |
| 2679 | + | |
| 2680 | + | |
| 2681 | + | |
| 2682 | + | |
| 2683 | + | |
| 2684 | + | |
| 2685 | + | |
| 2686 | + | |
2674 | 2687 | | |
2675 | 2688 | | |
2676 | 2689 | | |
| |||
2693 | 2706 | | |
2694 | 2707 | | |
2695 | 2708 | | |
| 2709 | + | |
| 2710 | + | |
| 2711 | + | |
| 2712 | + | |
| 2713 | + | |
| 2714 | + | |
2696 | 2715 | | |
2697 | 2716 | | |
2698 | 2717 | | |
| |||
2719 | 2738 | | |
2720 | 2739 | | |
2721 | 2740 | | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
| 2745 | + | |
2722 | 2746 | | |
2723 | 2747 | | |
2724 | 2748 | | |
| |||
0 commit comments