Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
DE-1650 Tap-hubspot - Issue regarding upgrade (#43)
Browse files Browse the repository at this point in the history
* Removed post process

* Removed singer

* Remove lines

* Remove line client.py

* Remove line events_stream

* Removed line marketing stream

* removed line
  • Loading branch information
SBurwash authored May 17, 2023
1 parent ada4a46 commit b062921
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 22 deletions.
2 changes: 0 additions & 2 deletions tap_hubspot/analytics_streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# from black import Report
from math import inf
import requests
import singer
import json

from dateutil import parser
Expand All @@ -28,7 +27,6 @@

SCHEMAS_DIR = Path(__file__).parent / Path("./schemas")

LOGGER = singer.get_logger()
utc=pytz.UTC

from tap_hubspot.schemas.analytics import (
Expand Down
2 changes: 0 additions & 2 deletions tap_hubspot/automation_streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# from black import Report
from math import inf
import requests
import singer

import datetime, pytz
from datetime import datetime
Expand All @@ -20,7 +19,6 @@

SCHEMAS_DIR = Path(__file__).parent / Path("./schemas")

LOGGER = singer.get_logger()
utc=pytz.UTC

from tap_hubspot.schemas.automation import (
Expand Down
12 changes: 0 additions & 12 deletions tap_hubspot/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@
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
from singer_sdk.authenticators import BearerTokenAuthenticator
from singer_sdk import typing as th

SCHEMAS_DIR = Path(__file__).parent / Path("./schemas")
LOGGER = singer.get_logger()


class HubspotStream(RESTStream):
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions tap_hubspot/events_streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# from black import Report
from math import inf
import requests
import singer
import json

from dateutil import parser
Expand All @@ -27,7 +26,6 @@

SCHEMAS_DIR = Path(__file__).parent / Path("./schemas")

LOGGER = singer.get_logger()
utc=pytz.UTC

from tap_hubspot.schemas.events import (
Expand Down
2 changes: 0 additions & 2 deletions tap_hubspot/marketing_streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from asyncio.log import logger
from math import inf
import requests
import singer
import json

from dateutil import parser
Expand All @@ -29,7 +28,6 @@

SCHEMAS_DIR = Path(__file__).parent / Path("./schemas")

LOGGER = singer.get_logger()
utc=pytz.UTC

from tap_hubspot.schemas.marketing import (
Expand Down
2 changes: 0 additions & 2 deletions tap_hubspot/streams.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Stream type classes for tap-hubspot."""
# from black import Report
import requests
import singer
import json

from dateutil import parser
Expand All @@ -24,7 +23,6 @@

SCHEMAS_DIR = Path(__file__).parent / Path("./schemas")

LOGGER = singer.get_logger()
utc = pytz.UTC


Expand Down

0 comments on commit b062921

Please sign in to comment.