Skip to content

Commit

Permalink
Bump v2.0.2 (#32)
Browse files Browse the repository at this point in the history
* bump version changes

* fix (actions: enddate) add required enddate param (#31)

---------

Co-authored-by: “rdeshmukh15” <“[email protected]”>
Co-authored-by: Christian Shum-Harden <[email protected]>
  • Loading branch information
3 people authored Sep 3, 2024
1 parent 4b34998 commit 3f5f619
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 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.0.2
* Adds end date in params for Actions and related streams [#31](https://github.com/singer-io/tap-impact/pull/31)

## 2.0.1
* Dependabot update [#25](https://github.com/singer-io/tap-impact/pull/25)

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, find_packages

setup(name='tap-impact',
version='2.0.1',
version='2.0.2',
description='Singer.io tap for extracting data from the Impact Advertiser, Partner, Agency APIs',
author='[email protected]',
classifiers=['Programming Language :: Python :: 3 :: Only'],
Expand Down
9 changes: 6 additions & 3 deletions tap_impact/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
'data_key': 'Actions',
'params': {
'CampaignId': '<parent_id>',
'ActionDateStart': '<last_datetime>'
'ActionDateStart': '<last_datetime>',
'ActionDateEnd': '<current_datetime>',
},
'key_properties': ['id'],
'replication_method': 'INCREMENTAL',
Expand All @@ -50,7 +51,8 @@
'data_key': 'ActionInquiries',
'params': {
'CampaignId': '<parent_id>',
'StartDate': '<last_datetime>'
'StartDate': '<last_datetime>',
'EndDate': '<current_datetime>'
},
'key_properties': ['id'],
'replication_method': 'INCREMENTAL',
Expand All @@ -62,7 +64,8 @@
'data_key': 'ActionUpdates',
'params': {
'CampaignId': '<parent_id>',
'StartDate': '<last_datetime>'
'StartDate': '<last_datetime>',
'EndDate': '<current_datetime>'
},
'key_properties': ['id'],
'replication_method': 'INCREMENTAL',
Expand Down
9 changes: 7 additions & 2 deletions tap_impact/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ def sync_endpoint(client,

end_dttm = utils.now()
end_dt = end_dttm.date()
end_dt_str = end_dt.strftime('%Y-%m-%dT%H:%M:%SZ')
start_dttm = end_dttm
start_dt = end_dt

Expand Down Expand Up @@ -190,8 +191,12 @@ def sync_endpoint(client,

if page == 1 and not params == {}:
param_string = '&'.join(['%s=%s' % (key, value) for (key, value) in params.items()])
querystring = param_string.replace('<parent_id>', str(parent_id)).replace(
'<last_datetime>', strptime_to_utc(last_datetime).strftime('%Y-%m-%dT%H:%M:%SZ'))
querystring = (
param_string
.replace('<parent_id>', str(parent_id))
.replace('<last_datetime>', strptime_to_utc(last_datetime).strftime('%Y-%m-%dT%H:%M:%SZ'))
.replace('<current_datetime>', strptime_to_utc(end_dt_str).strftime('%Y-%m-%dT%H:%M:%SZ'))
)
else:
querystring = None
LOGGER.info('URL for Stream {}: {}{}'.format(
Expand Down

0 comments on commit 3f5f619

Please sign in to comment.