Stripe Discount warehouse sync fails with KeyError: 'created'
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 39.9k
- Forks
- 3.4k
- Avg merge
- 6h 51m
- Merged PRs (30d)
- 232
Description
Bug
Stripe Discount schema sync fails with:
KeyError: 'created'
Why
Stripe Discount objects expose start / end, not created (Discount object).
Empty Discount syncs succeed (0 rows, webhook-only short-circuit). Once real customer.discount.* events arrive (e.g. coupon applied to a subscription), the webhook→warehouse path crashes looking up created.
Repro
- Connect Stripe with Discount schema enabled (
sync_type: webhook) - Apply a coupon to a customer/subscription so
customer.discount.createdfires - Observe Discount sync fail with
KeyError: 'created'
Expected
Discount rows land in stripe_discount using start (or coalesce created/start) as the timestamp field.
Impact
- Source shows Failed; Discount table never created
- Under webhook mode,
stripe_subscription.discountsis only["di_…"]IDs with no join target - Other Stripe schemas continue syncing normally
Suggested fix
In the Stripe Discount webhook ingest path, do not assume obj['created'] — use start for Discount objects.
Context
- Cloud project, Stripe API version pinned to
2024-09-30.acacia - Also reported via PostHog agent-feedback channel
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the Stripe Discount webhook ingest path and search for the lookup of obj['created']; inspect how customer.discount.* events are transformed for warehouse sync. Reproduce with a real Discount event, then verify that a stripe_discount row is created using the Discount timestamp and that other Stripe schemas continue syncing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, data-engineering
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100