Commit c8a2643
committed
fix: Update RecordExpander to return nothing when path doesn't exist
Changes:
- Add back 'else: yield from []' in DpathExtractor for explicit empty case
- Update RecordExpander to return nothing when expand_records_from_field path doesn't exist or isn't a list
- Update unit tests to expect no records instead of original record when expansion fails
This makes RecordExpander stricter: it only emits records when successfully expanding a list.
For Stripe invoice_line_items, this ensures we only emit line items, not invoice objects.
All 24 tests passing. Requested by @DanyloGL.
Co-Authored-By: unknown <>1 parent b04e174 commit c8a2643
File tree
3 files changed
+6
-6
lines changed- airbyte_cdk/sources/declarative
- expanders
- extractors
- unit_tests/sources/declarative/extractors
3 files changed
+6
-6
lines changedLines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | 61 | | |
63 | 62 | | |
64 | 63 | | |
65 | | - | |
66 | 64 | | |
67 | 65 | | |
68 | 66 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
| 194 | + | |
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
201 | | - | |
| 201 | + | |
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
238 | | - | |
| 237 | + | |
| 238 | + | |
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| |||
0 commit comments