Skip to content

Commit

Permalink
updated prospects stream sync function (#42)
Browse files Browse the repository at this point in the history
* updated prospects stream sync function
* updated cci config
  • Loading branch information
somethingmorerelevant authored Feb 19, 2024
1 parent 39b8ca3 commit 29ff131
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 2 deletions.
51 changes: 51 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
version: 2.1
jobs:
build:
docker:
- image: 218546966473.dkr.ecr.us-east-1.amazonaws.com/circle-ci:stitch-tap-tester
steps:
- checkout
- run:
name: 'Setup virtual env'
command: |
python3 -mvenv /usr/local/share/virtualenvs/tap-pardot
source /usr/local/share/virtualenvs/tap-pardot/bin/activate
pip install -U 'pip==22.2.2' 'setuptools==65.3.0'
pip install -U pylint
pip install .[dev]
- run:
name: 'JSON Validator'
command: |
source /usr/local/share/virtualenvs/tap-tester/bin/activate
stitch-validate-json tap_pardot/schemas/*.json
- run:
name: 'pylint'
command: |
source /usr/local/share/virtualenvs/tap-pardot/bin/activate
pylint tap_pardot -d C,R,W
- run:
name: 'Integration Tests'
command: |
aws s3 cp s3://com-stitchdata-dev-deployment-assets/environments/tap-tester/tap_tester_sandbox dev_env.sh
source dev_env.sh
source /usr/local/share/virtualenvs/tap-tester/bin/activate
run-test --tap=tap-pardot tests
workflows:
version: 2
commit:
jobs:
- build:
context: circleci-user
build_daily:
triggers:
- schedule:
cron: "0 0 * * *"
filters:
branches:
only:
- master
jobs:
- build:
context: circleci-user
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 1.4.5
* Prospects Stream Fix Pagination [#42](https://github.com/singer-io/tap-pardot/pull/42)

## 1.4.4
* Dependabot update [#41](https://github.com/singer-io/tap-pardot/pull/41)

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 @@

setup(
name="tap-pardot",
version="1.4.4",
version="1.4.5",
description="Singer.io tap for extracting data",
author="Stitch",
url="http://singer.io",
Expand Down
20 changes: 19 additions & 1 deletion tap_pardot/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def get_parent_ids(self, parent):

def sync(self):
self.pre_sync()

# pylint: disable=E1102
parent = self.parent_class(
self.client, self.config, self.parent_bookmark, emit=False
)
Expand Down Expand Up @@ -376,6 +376,24 @@ class Prospects(UpdatedAtReplicationStream):

is_dynamic = False

def get_records(self):
offset = 0
params = self.get_params()
while True:
params["offset"] = offset
data = self.client.get(self.endpoint, **params)
records = data["result"]
if not records:
break
offset += 200
yield from records[self.data_key]

def sync(self):
self.pre_sync()
for rec in self.sync_page():
yield rec
self.post_sync()


class Opportunities(NoUpdatedAtSortingStream):
stream_name = "opportunities"
Expand Down

0 comments on commit 29ff131

Please sign in to comment.