Skip to content

Commit

Permalink
Revert pr (#59)
Browse files Browse the repository at this point in the history
* Revert "Fix customer event transform error (#53)"

This reverts commit 47a321e.

* Bump to v1.4.2

* Update changelog
  • Loading branch information
luandy64 authored Apr 3, 2020
1 parent 0e99483 commit e60dab4
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 118 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

** 1.4.2
* Revert 1.4.1

** 1.4.1
* Add functionality that recursively converts `StripeObject`s to dictionaries. [#53](https://github.com/singer-io/tap-stripe/pull/53)

Expand Down
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name="tap-stripe",
version="1.4.1",
version="1.4.2",
description="Singer.io tap for extracting data",
author="Stitch",
url="http://singer.io",
Expand All @@ -17,8 +17,7 @@
'dev': [
'ipdb==0.11',
'pylint==2.1.1',
'astroid==2.1.0',
'nose==1.3.7'
'astroid==2.1.0'
]
},
entry_points="""
Expand Down
15 changes: 1 addition & 14 deletions tap_stripe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,18 +662,6 @@ def should_sync_event(events_obj, object_type, id_to_created_map):
id_to_created_map[event_resource_id] = events_obj.created
return should_sync

def recursive_to_dict(some_obj):
if isinstance(some_obj, stripe.stripe_object.StripeObject):
return recursive_to_dict(dict(some_obj))

if isinstance(some_obj, list):
return [recursive_to_dict(item) for item in some_obj]

if isinstance(some_obj, dict):
return {key: recursive_to_dict(value) for key, value in some_obj.items()}

# Else just return
return some_obj

def sync_event_updates(stream_name):
'''
Expand Down Expand Up @@ -740,8 +728,7 @@ def sync_event_updates(stream_name):

invoice_obj['lines']['data'] = filtered_line_items

rec = recursive_to_dict(event_resource_obj)
rec = unwrap_data_objects(rec)
rec = unwrap_data_objects(event_resource_obj.to_dict_recursive())
rec = reduce_foreign_keys(rec, stream_name)
rec["updated"] = events_obj.created
rec = transformer.transform(
Expand Down
56 changes: 7 additions & 49 deletions tap_stripe/schemas/customers.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,55 +76,13 @@
}
},
"sources": {
"anyOf": [
{
"type": [
"null",
"array"
],
"items": {
"$ref" : "shared/source.json#/"
}
},
{
"type": [
"null",
"object"
],
"properties": {
"$ref" : "shared/source.json#/"
}
},
{
"type": [
"null",
"object"
],
"properties": {
"object": {
"type": [
"null",
"string"
]
},
"has_more": {
"type": [
"null",
"boolean"
]
},
"url": {
"type": [
"null",
"string"
]
},
"data": {
"$ref" : "shared/source.json#/"
}
}
}
]
"type": [
"null",
"array"
],
"items": {
"$ref" : "shared/source.json#/"
}
},
"delinquent": {
"type": [
Expand Down
52 changes: 0 additions & 52 deletions tests/unittests/test_recursive_to_dict.py

This file was deleted.

0 comments on commit e60dab4

Please sign in to comment.