Skip to content

Commit

Permalink
- fix out-of-index error
Browse files Browse the repository at this point in the history
- bump version 2.13.2
  • Loading branch information
RushiT0122 committed Jan 23, 2024
1 parent cc99bee commit 4b10340
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 2.13.2
* Fix out-of-index error [#253](https://github.com/singer-io/tap-hubspot/pull/253)

## 2.13.1
* Optimise contacts_by_company implementation [#250](https://github.com/singer-io/tap-hubspot/pull/250)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from setuptools import setup

setup(name='tap-hubspot',
version='2.13.1',
version='2.13.2',
description='Singer.io tap for extracting data from the HubSpot API',
author='Stitch',
url='http://singer.io',
Expand Down
6 changes: 5 additions & 1 deletion tap_hubspot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,10 +569,15 @@ def use_recent_companies_endpoint(response):

# NB> to do: support stream aliasing and field selection
def _sync_contacts_by_company_batch_read(STATE, ctx, company_ids):
# Return state as it is if company ids list is empty
if not len(company_ids):
return STATE

schema = load_schema(CONTACTS_BY_COMPANY)
catalog = ctx.get_catalog_from_id(singer.get_currently_syncing(STATE))
mdata = metadata.to_map(catalog.get('metadata'))
url = get_url("contacts_by_company_v3")

with Transformer(UNIX_MILLISECONDS_INTEGER_DATETIME_PARSING) as bumble_bee:
with metrics.record_counter(CONTACTS_BY_COMPANY) as counter:
body = {'inputs': [{'id': company_id} for company_id in company_ids]}
Expand All @@ -584,7 +589,6 @@ def _sync_contacts_by_company_batch_read(STATE, ctx, company_ids):
'contact-id' : contact['id']}
record = bumble_bee.transform(lift_properties_and_versions(record), schema, mdata)
singer.write_record("contacts_by_company", record, time_extracted=utils.now())
if len(company_ids):
STATE = singer.set_offset(STATE, "contacts_by_company", 'offset', company_ids[-1])
singer.write_state(STATE)
return STATE
Expand Down

0 comments on commit 4b10340

Please sign in to comment.