-
Notifications
You must be signed in to change notification settings - Fork 5k
fix(source-stripe): Fix invoice_line_items incremental stream to emit line items instead of invoices (do not merge) #70294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…ms incremental stream - Override record_selector in incremental_stream retriever to add expansion - Extract invoice objects from data.object path - Expand lines.data array using expand_records_from_field parameter - Preserve parent invoice context with remain_original_record - Update transformations to extract invoice fields from original_record - Add RemoveFields to clean up original_record after extracting needed fields - Fixes issue where incremental sync emitted invoice objects instead of line items Co-Authored-By: unknown <>
Co-Authored-By: unknown <>
Original prompt from API User |
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. Helpful Resources
PR Slash CommandsAirbyte Maintainers (that's you!) can execute the following slash commands on your PR:
|
… syntax Update invoice_line_items incremental stream to use the new RecordExpander class structure instead of direct parameters on DpathExtractor. Changes: - Move expand_records_from_field and remain_original_record into nested record_expander configuration - Add explicit type: RecordExpander to enable proper component instantiation This aligns with the CDK refactoring that extracted record expansion logic into a dedicated RecordExpander component. Co-Authored-By: unknown <>
|
This PR depends on unreleased CDK changes and cannot be merged until the CDK PR is merged and this connector is updated to use the new CDK version.
Link to Devin run: https://app.devin.ai/sessions/d5533ef9d14f4ec48f39aeb8eb80ed37
Requested by: Daryna (@DanyloGL)
Related issue: airbytehq/oncall#8683
What
Fixes the
invoice_line_itemsincremental stream which was incorrectly emitting full invoice objects instead of individual line items.The root cause: The incremental stream uses the Stripe events endpoint which returns invoice objects with nested
lines.dataarrays. The stream was emitting the entire invoice object instead of extracting and emitting each line item separately.How
Uses new CDK functionality (
expand_records_from_fieldandremain_original_recordparameters in DpathExtractor) to:expand_records_from_field: ["lines", "data"]parameter tells the extractor to expand the nestedlines.dataarray and emit each item as a separate recordremain_original_record: trueparameter embeds the parent invoice object in each expanded line item record under theoriginal_recordfieldrecord_filterto only emit records that haveoriginal_recordfield, preventing parent invoice objects from being emitted whenlines.datais missing or emptyinvoice_id,invoice_created,invoice_updated) from the embeddedoriginal_recordRemoveFieldstransformation to remove theoriginal_recordfield from the final outputReview guide
record_selectorconfiguration with expansion and filtering logic"{{ 'original_record' in record }}"is correctlines.datais missing/emptyoriginal_recordare safe (use.get()with defaults)invoice_updated,invoice_id, andinvoice_createdare extracted correctlyRemoveFieldsproperly cleans uporiginal_recordlines.dataarrays (should emit nothing, not the parent invoice)lines.datafield (should emit nothing, not the parent invoice)invoice.deletedevents (may not have line items)User Impact
Positive:
invoice_line_itemsstream instead of full invoice objectsinvoice_id,invoice_created,invoice_updated)Negative:
Can this PR be safely reverted and rolled back?
Reason: This changes the fundamental data structure of the
invoice_line_itemsstream. Reverting would cause inconsistency between historical and new data. If issues arise, a forward fix would be preferred.Testing Notes
Once the CDK dependency is available: