forked from dbt-labs/tap-trustpilot
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Tap trustpilot intial changes - Discover mode, Sync mode, bulk request. #1
Merged
Merged
Changes from 9 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
14f7c1f
inital changes: import statements, singer-python version sync change
857fb13
Initial refactor for the discover mode changes
sgandhi1311 44c4c91
Moved discover logic code from __init__ file to discover.py file
sgandhi1311 25d3dbf
alpha:0.2.0 release changes
6ff394b
added change logs
kethan1122 8deedab
merge with discover_mode_changes branch
kethan1122 afb5124
format changelog.md
kethan1122 45ed467
Handled consumer sync logic and Removed unused code
sgandhi1311 8310128
removed version number and change logs
kethan1122 7b13937
Merge branch 'master' into tap-trustpilot/intial_changes
kethan1122 aefeb87
circleci yml syntax error
kethan1122 46034f0
Merge branch 'tap-trustpilot/intial_changes' of github.com:singer-io/…
kethan1122 c40c755
circleci yml syntax error
kethan1122 e2e934d
tap name error
kethan1122 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
version: 2.1 | ||
orbs: | ||
slack: circleci/slack@3.4.2 | ||
|
||
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-trustpilot | ||
source /usr/local/share/virtualenvs/tap-trustpilot>/bin/activate | ||
pip install -U pip setuptools | ||
pip install .[dev] | ||
- run: | ||
name: 'JSON Validator' | ||
command: | | ||
source /usr/local/share/virtualenvs/tap-tester/bin/activate | ||
stitch-validate-json tap_trustpilot/schemas/*.json | ||
- run: | ||
name: 'pylint' | ||
command: | | ||
source /usr/local/share/virtualenvs/tap-trustpilot/bin/activate | ||
pylint tap_trustpilot --disable C,W,R | ||
- run: | ||
name: 'Unit Tests' | ||
# command: | | ||
# source /usr/local/share/virtualenvs/tap-trustpilot/bin/activate | ||
# pip install coverage | ||
# nosetests --with-coverage --cover-erase --cover-package=tap_trustpilot --cover-html-dir=htmlcov tests/unittests | ||
# coverage html | ||
# - store_test_results: | ||
# path: test_output/report.xml | ||
# - store_artifacts: | ||
# path: htmlcov | ||
- 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 | ||
# pip install .[dev,test] # Install tap for the test client subclass usage | ||
# run-test --tap=tap-trustpilot tests | ||
|
||
workflows: | ||
version: 2 | ||
commit: | ||
jobs: | ||
- build: | ||
context: circleci-user | ||
build_daily: | ||
triggers: | ||
- schedule: | ||
cron: "0 13 * * *" | ||
filters: | ||
branches: | ||
only: | ||
- master |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from singer.catalog import Catalog, CatalogEntry, Schema | ||
from tap_trustpilot import schemas | ||
|
||
def check_credentials_are_authorized(ctx): | ||
ctx.client.auth(ctx.config) | ||
|
||
def discover(ctx): | ||
check_credentials_are_authorized(ctx) | ||
discover_schemas, field_metadata = schemas.get_schemas() | ||
streams = [] | ||
for stream_name, raw_schema in discover_schemas.items(): | ||
schema = Schema.from_dict(raw_schema) | ||
mdata = field_metadata[stream_name] | ||
streams.append( | ||
CatalogEntry( | ||
tap_stream_id=stream_name, | ||
stream=stream_name, | ||
schema=schema, | ||
key_properties=schemas.PK_FIELDS[stream_name], | ||
metadata=mdata | ||
) | ||
) | ||
return Catalog(streams) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add comments to the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done