Skip to content

Commit

Permalink
Revert "Add subsciption and subscription_item to line_item PK (#28)"
Browse files Browse the repository at this point in the history
This reverts commit 0d16f4e.
  • Loading branch information
dmosorast committed Jun 13, 2019
1 parent 63c71ef commit 72d7d9d
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions tap_stripe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@
'invoices': {'sdk_object': stripe.Invoice, 'key_properties': ['id']},
'invoice_items': {'sdk_object': stripe.InvoiceItem, 'key_properties': ['id']},
'invoice_line_items': {'sdk_object': stripe.InvoiceLineItem,
'key_properties': ['id',
'invoice',
'subscription',
'subscription_item']},
'key_properties': ['id', 'invoice']},
'transfers': {'sdk_object': stripe.Transfer, 'key_properties': ['id']},
'coupons': {'sdk_object': stripe.Coupon, 'key_properties': ['id']},
'subscriptions': {'sdk_object': stripe.Subscription, 'key_properties': ['id']},
Expand Down Expand Up @@ -590,14 +587,6 @@ def sync_sub_stream(sub_stream_name, parent_obj, updates=False):
if sub_stream_name == "invoice_line_items":
# Synthetic addition of a key to the record we sync
obj_ad_dict["invoice"] = parent_obj.id

# Line item PKs must be a combination of all unique IDs associated
# with the different types a line item can be
# If they are not populated, they must be added here.
if "subscription" not in obj_ad_dict:
obj_ad_dict["subscription"] = None
if "subscription_item" not in obj_ad_dict:
obj_ad_dict["subscription_item"] = None
elif sub_stream_name == "payout_transactions":
# payout_transactions is a join table
obj_ad_dict = {"id": obj_ad_dict['id'], "payout_id": parent_obj['id']}
Expand Down

0 comments on commit 72d7d9d

Please sign in to comment.