Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/hgi 4939 #21

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tap_hubspot_beta/client_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def get_url_params(
if next_page_token:
params.update(next_page_token)
params.update(self.additional_prarams)
params["property"] = self.selected_properties
params["property"] = ",".join(self.selected_properties)
return params

def post_process(self, row: dict, context: Optional[dict]) -> dict:
Expand Down
4 changes: 2 additions & 2 deletions tap_hubspot_beta/client_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def prepare_request_payload(
if self.name =="deals_association_parent":
payload["properties"] = ["id"]
else:
payload["properties"] = self.selected_properties
payload["properties"] = ",".join(self.selected_properties)
else:
payload["properties"] = []
return payload
Expand Down Expand Up @@ -205,7 +205,7 @@ def get_url_params(
params["limit"] = self.page_size
params.update(self.additional_prarams)
if self.properties_url:
params["properties"] = self.selected_properties
params["properties"] = ",".join(self.selected_properties)
if next_page_token:
params["after"] = next_page_token
return params
Expand Down
10 changes: 10 additions & 0 deletions tap_hubspot_beta/streams.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Stream type classes for tap-hubspot."""
from datetime import datetime
from typing import Any, Dict, Iterable, List, Optional
import json
import copy

from singer_sdk.exceptions import InvalidStreamSortException
Expand Down Expand Up @@ -165,6 +166,15 @@ def parse_response(self, response):
for identity in identity_profile["identities"]:
if identity['type'] == 'EMAIL':
record['subscriber_email'] = identity['value']
if record.get("custom_fields", []):
stringfied_custom_fields = []
for custom_field in record["custom_fields"]:
if isinstance(custom_field, dict):
stringfied_custom_fields.append(
json.dumps(custom_field)
)


yield record

def get_child_context(self, record: dict, context: Optional[dict]) -> dict:
Expand Down