From b062921453fe12a5df06170db4669eba2f809122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Burwash?= <35510512+SBurwash@users.noreply.github.com> Date: Wed, 17 May 2023 09:59:01 -0400 Subject: [PATCH] DE-1650 Tap-hubspot - Issue regarding upgrade (#43) * Removed post process * Removed singer * Remove lines * Remove line client.py * Remove line events_stream * Removed line marketing stream * removed line --- tap_hubspot/analytics_streams.py | 2 -- tap_hubspot/automation_streams.py | 2 -- tap_hubspot/client.py | 12 ------------ tap_hubspot/events_streams.py | 2 -- tap_hubspot/marketing_streams.py | 2 -- tap_hubspot/streams.py | 2 -- 6 files changed, 22 deletions(-) diff --git a/tap_hubspot/analytics_streams.py b/tap_hubspot/analytics_streams.py index ae017ed..8e6240a 100644 --- a/tap_hubspot/analytics_streams.py +++ b/tap_hubspot/analytics_streams.py @@ -2,7 +2,6 @@ # from black import Report from math import inf import requests -import singer import json from dateutil import parser @@ -28,7 +27,6 @@ SCHEMAS_DIR = Path(__file__).parent / Path("./schemas") -LOGGER = singer.get_logger() utc=pytz.UTC from tap_hubspot.schemas.analytics import ( diff --git a/tap_hubspot/automation_streams.py b/tap_hubspot/automation_streams.py index 9d93613..50eb403 100644 --- a/tap_hubspot/automation_streams.py +++ b/tap_hubspot/automation_streams.py @@ -2,7 +2,6 @@ # from black import Report from math import inf import requests -import singer import datetime, pytz from datetime import datetime @@ -20,7 +19,6 @@ SCHEMAS_DIR = Path(__file__).parent / Path("./schemas") -LOGGER = singer.get_logger() utc=pytz.UTC from tap_hubspot.schemas.automation import ( diff --git a/tap_hubspot/client.py b/tap_hubspot/client.py index 35c0fc3..10fb784 100644 --- a/tap_hubspot/client.py +++ b/tap_hubspot/client.py @@ -5,9 +5,7 @@ from typing import Any, Dict, Optional, List, Iterable, Callable import pytz -import singer -from singer import utils from singer_sdk.exceptions import RetriableAPIError from singer_sdk.helpers.jsonpath import extract_jsonpath from singer_sdk.streams import RESTStream @@ -15,7 +13,6 @@ from singer_sdk import typing as th SCHEMAS_DIR = Path(__file__).parent / Path("./schemas") -LOGGER = singer.get_logger() class HubspotStream(RESTStream): @@ -90,15 +87,6 @@ def parse_response(self, response: requests.Response) -> Iterable[dict]: """Parse the response and return an iterator of result rows.""" yield from extract_jsonpath(self.records_jsonpath, input=response.json()) - def post_process(self, row: dict, context: Optional[dict]) -> dict: - """As needed, append or transform raw data to match expected structure. - Returns row, or None if row is to be excluded""" - - if self.replication_key: - if utils.strptime_to_utc(row[self.replication_key]) <= self.get_starting_timestamp(context).astimezone(pytz.utc): - return None - return row - def get_json_schema(self, from_type: str) -> dict: """Return the JSON Schema dict that describes the sql type. diff --git a/tap_hubspot/events_streams.py b/tap_hubspot/events_streams.py index 45f5cce..6ea992a 100644 --- a/tap_hubspot/events_streams.py +++ b/tap_hubspot/events_streams.py @@ -2,7 +2,6 @@ # from black import Report from math import inf import requests -import singer import json from dateutil import parser @@ -27,7 +26,6 @@ SCHEMAS_DIR = Path(__file__).parent / Path("./schemas") -LOGGER = singer.get_logger() utc=pytz.UTC from tap_hubspot.schemas.events import ( diff --git a/tap_hubspot/marketing_streams.py b/tap_hubspot/marketing_streams.py index 732af89..24f720e 100644 --- a/tap_hubspot/marketing_streams.py +++ b/tap_hubspot/marketing_streams.py @@ -3,7 +3,6 @@ from asyncio.log import logger from math import inf import requests -import singer import json from dateutil import parser @@ -29,7 +28,6 @@ SCHEMAS_DIR = Path(__file__).parent / Path("./schemas") -LOGGER = singer.get_logger() utc=pytz.UTC from tap_hubspot.schemas.marketing import ( diff --git a/tap_hubspot/streams.py b/tap_hubspot/streams.py index 2805c99..96db20c 100644 --- a/tap_hubspot/streams.py +++ b/tap_hubspot/streams.py @@ -1,7 +1,6 @@ """Stream type classes for tap-hubspot.""" # from black import Report import requests -import singer import json from dateutil import parser @@ -24,7 +23,6 @@ SCHEMAS_DIR = Path(__file__).parent / Path("./schemas") -LOGGER = singer.get_logger() utc = pytz.UTC