From 655e98093c4e069581fc7d0db87b18fb53a5749d Mon Sep 17 00:00:00 2001 From: Jon Brenner Date: Fri, 18 Oct 2019 16:04:52 -0600 Subject: [PATCH 1/2] made stripe work --- hooks/stripe_hook.py | 2 +- operators/stripe_to_s3_operator.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hooks/stripe_hook.py b/hooks/stripe_hook.py index 570b301..53d09f1 100755 --- a/hooks/stripe_hook.py +++ b/hooks/stripe_hook.py @@ -49,7 +49,7 @@ def run_query(self, method_to_call = 'all' if replication_key_value: stripe_response = getattr(stripe_endpoint, method_to_call)( - ending_before=replication_key_value, **kwargs) + starting_after=replication_key_value, **kwargs) else: stripe_response = getattr(stripe_endpoint, method_to_call)(**kwargs) diff --git a/operators/stripe_to_s3_operator.py b/operators/stripe_to_s3_operator.py index b91685a..63e5ddf 100755 --- a/operators/stripe_to_s3_operator.py +++ b/operators/stripe_to_s3_operator.py @@ -57,7 +57,7 @@ class StripeToS3Operator(BaseOperator, SkipMixin): :type replication_key_value: String """ - template_field = ('s3_key', ) + template_fields = ("s3_key", ) @apply_defaults def __init__(self, @@ -122,7 +122,7 @@ def execute(self, context): return True else: - dest_s3 = S3Hook(s3_conn_id=self.s3_conn_id) + dest_s3 = S3Hook(self.s3_conn_id) dest_s3.load_file( filename=tmp.name, key=self.s3_key, @@ -130,7 +130,7 @@ def execute(self, context): replace=True ) - dest_s3.connection.close() + tmp.close() def filter_fields(self, result): From 5e398810e9c6bf7647cc3db51ac1465734ecc1ca Mon Sep 17 00:00:00 2001 From: Jon Brenner Date: Wed, 15 Jan 2020 16:37:05 -0700 Subject: [PATCH 2/2] rkv fix --- operators/stripe_to_s3_operator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/operators/stripe_to_s3_operator.py b/operators/stripe_to_s3_operator.py index 63e5ddf..1354dae 100755 --- a/operators/stripe_to_s3_operator.py +++ b/operators/stripe_to_s3_operator.py @@ -57,7 +57,7 @@ class StripeToS3Operator(BaseOperator, SkipMixin): :type replication_key_value: String """ - template_fields = ("s3_key", ) + template_fields = ("s3_key", "replication_key_value") @apply_defaults def __init__(self,