diff --git a/pyproject.toml b/pyproject.toml index 166f2b9..9842658 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "tap-gladly" -version = "0.4.0" +version = "0.4.1" description = "`tap-gladly` is a Singer tap for gladly, built with the Meltano SDK for Singer Taps." authors = ["harrystech"] keywords = [ diff --git a/tap_gladly/streams.py b/tap_gladly/streams.py index bdc12a2..82c2e20 100644 --- a/tap_gladly/streams.py +++ b/tap_gladly/streams.py @@ -48,10 +48,17 @@ class ExportFile(gladlyStream, abc.ABC): def get_records(self, context: Optional[Dict[Any, Any]]): """Get records that exists, ignoring older jobs if max_job_lookback is setup.""" if not context: + logging.warning("Context is empty, nothing to do") return [] period = pendulum.now().diff(pendulum.parse(context["updatedAt"])).in_days() if "max_job_lookback" in self.config: + logging.info( + f"Max job lookback is set to {self.config['max_job_lookback']}" + ) if period <= self.config["max_job_lookback"]: + logging.info( + f"{period} <= {self.config['max_job_lookback']}, syncing ..." + ) return super().get_records(context) else: logging.warning( @@ -80,7 +87,7 @@ def parse_response(self, response: requests.Response) -> Iterable[dict]: yield from extract_jsonpath(self.records_jsonpath, input=json.loads(line)) -class ExportFileConversationItemsAllTypesStream(gladlyStream): +class ExportFileConversationItemsAllTypesStream(ExportFile): """Stream with all the conversations and content type.""" name = "conversation_all_types"