From a4fe02dd202781be37570c6823fe742df6156217 Mon Sep 17 00:00:00 2001 From: Keyna Rafael <95432445+keyn4@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:17:58 -0500 Subject: [PATCH] fix apply_catalog to make rep_key work dynamically (#30) --- tap_stripe/streams.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tap_stripe/streams.py b/tap_stripe/streams.py index 68a547e..e3fc123 100644 --- a/tap_stripe/streams.py +++ b/tap_stripe/streams.py @@ -797,7 +797,16 @@ def replication_key(self): th.Property("total_usage", th.IntegerType), th.Property("exchange_rate", th.NumberType), ).to_dict() - + + def apply_catalog(self, catalog) -> None: + self._tap_input_catalog = catalog + catalog_entry = catalog.get_stream(self.name) + if catalog_entry: + self.primary_keys = catalog_entry.key_properties + if catalog_entry.replication_method: + self.forced_replication_method = catalog_entry.replication_method + + class ChargesStream(stripeStream): name = "charges"