Skip to content

Commit

Permalink
Skip empty records during sync (#15)
Browse files Browse the repository at this point in the history
* Skip empty records during sync

* Handling for empty invoice_plans in plans stream
  • Loading branch information
xacadil authored Apr 1, 2024
1 parent ba640a1 commit d6da5e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tap_stripe/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def parse_response(self, response: requests.Response) -> Iterable[dict]:

invoice_plans = []
[invoice_plans.extend(item.get("data", {}).get("object", {}).get("lines", {}).get("data", [])) for item in records if (item["type"].startswith("invoice"))]
invoice_plans = [item.get("price", item.get("plan")) for item in invoice_plans]
invoice_plans = [item.get("price") or item.get("plan") for item in invoice_plans if item.get("price") is not None or item.get("plan") is not None]

# Combine both sets of plans
records = plans + subscription_plans + invoice_plans
Expand Down

0 comments on commit d6da5e0

Please sign in to comment.