Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎉Source Chartmogul: Migrate connector from Alpha (Python) to Beta (YA…
…ML) (#19276) Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>
- Loading branch information
Showing
14 changed files
with
197 additions
and
332 deletions.
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
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
33 changes: 21 additions & 12 deletions
33
airbyte-integrations/connectors/source-chartmogul/acceptance-test-config.yml
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 |
---|---|---|
@@ -1,20 +1,29 @@ | ||
# See [Source Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/source-acceptance-tests-reference) | ||
# for more information about how to configure these tests | ||
connector_image: airbyte/source-chartmogul:dev | ||
tests: | ||
acceptance_tests: | ||
spec: | ||
- spec_path: "source_chartmogul/spec.json" | ||
tests: | ||
- spec_path: "source_chartmogul/spec.yaml" | ||
connection: | ||
- config_path: "secrets/config.json" | ||
status: "succeed" | ||
- config_path: "integration_tests/invalid_config.json" | ||
status: "failed" | ||
tests: | ||
- config_path: "secrets/config.json" | ||
status: "succeed" | ||
- config_path: "integration_tests/invalid_config.json" | ||
status: "failed" | ||
discovery: | ||
- config_path: "secrets/config.json" | ||
tests: | ||
- config_path: "secrets/config.json" | ||
basic_read: | ||
- config_path: "secrets/config.json" | ||
configured_catalog_path: "integration_tests/configured_catalog.json" | ||
empty_streams: ["activities"] | ||
tests: | ||
- config_path: "secrets/config.json" | ||
configured_catalog_path: "integration_tests/configured_catalog.json" | ||
expect_records: | ||
path: "integration_tests/expected_records.txt" | ||
extra_fields: no | ||
exact_order: no | ||
extra_records: yes | ||
full_refresh: | ||
- config_path: "secrets/config.json" | ||
configured_catalog_path: "integration_tests/configured_catalog.json" | ||
tests: | ||
- config_path: "secrets/config.json" | ||
configured_catalog_path: "integration_tests/configured_catalog.json" |
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
3 changes: 3 additions & 0 deletions
3
airbyte-integrations/connectors/source-chartmogul/integration_tests/expected_records.txt
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,3 @@ | ||
{"stream":"customers","data":{"id":72038151,"uuid":"cus_e6e6b1e6-72d4-11ec-ac99-47c8cf90d52c","external_id":"cus_0001","name":"Adam Smith","email":"integration-test@airbyte.io","status":"Past Due","customer-since":"2015-11-01T00:00:00+00:00","attributes":{"custom":{},"clearbit":{},"stripe":{},"tags":[]},"data_source_uuid":"ds_2dbe3b80-72d4-11ec-bdef-0f585abe5bf3","data_source_uuids":["ds_2dbe3b80-72d4-11ec-bdef-0f585abe5bf3"],"external_ids":["cus_0001"],"company":"Airbyte","country":"US","state":"CA","city":"San Francisco","zip":"94121","lead_created_at":"2022-01-11T00:00:00.000Z","free_trial_started_at":"2022-01-11T00:00:00.000Z","address":{"country":"United States","state":"California","city":"San Francisco","address_zip":"94121"},"mrr":4100,"arr":49200,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#/customers/72038151-Airbyte","billing-system-type":"Import API","currency":"USD","currency-sign":"$"},"emitted_at":1668512244585} | ||
{"stream":"activities","data":{"description":"purchased the Bronze Plan plan with $10.00 discount applied","activity-mrr-movement":4100,"activity-mrr":4100,"activity-arr":49200,"date":"2015-11-01T00:00:00+00:00","type":"new_biz","currency":"USD","subscription-external-id":"sub_0001","plan-external-id":"bb8dcfe0-5505-013a-5d44-263d116b0774","customer-name":"Airbyte","customer-uuid":"cus_e6e6b1e6-72d4-11ec-ac99-47c8cf90d52c","customer-external-id":"cus_0001","billing-connector-uuid":"ds_2dbe3b80-72d4-11ec-bdef-0f585abe5bf3","uuid":"02a72371-72b1-440e-9816-d61435fd2e45"},"emitted_at":1668512245112} | ||
{"stream":"customer_count","data":{"date":"2022-01-01","customers":1,"percentage-change":0},"emitted_at":1668512245914} |
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
88 changes: 88 additions & 0 deletions
88
airbyte-integrations/connectors/source-chartmogul/source_chartmogul/chartmogul.yaml
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,88 @@ | ||
version: "0.2.0" | ||
|
||
definitions: | ||
selector: | ||
extractor: | ||
field_pointer: ["entries"] | ||
requester: | ||
url_base: "https://api.chartmogul.com" | ||
http_method: "GET" | ||
authenticator: | ||
type: BasicHttpAuthenticator | ||
username: "{{ config['api_key'] }}" | ||
retriever: | ||
record_selector: | ||
$ref: "*ref(definitions.selector)" | ||
requester: | ||
$ref: "*ref(definitions.requester)" | ||
customers_stream: | ||
retriever: | ||
$ref: "*ref(definitions.retriever)" | ||
paginator: | ||
type: DefaultPaginator | ||
url_base: "*ref(definitions.requester.url_base)" | ||
pagination_strategy: | ||
type: "PageIncrement" | ||
start_from_page: 1 | ||
page_size: 200 | ||
page_size_option: | ||
inject_into: request_parameter | ||
field_name: per_page | ||
page_token_option: | ||
inject_into: request_parameter | ||
field_name: page | ||
$options: | ||
name: "customers" | ||
primary_key: "id" | ||
path: "/v1/customers" | ||
activities_stream: | ||
retriever: | ||
$ref: "*ref(definitions.retriever)" | ||
requester: | ||
$ref: "*ref(definitions.requester)" | ||
request_options_provider: | ||
request_parameters: | ||
start-date: "{{ config.start_date }}" | ||
paginator: | ||
type: DefaultPaginator | ||
url_base: "*ref(definitions.requester.url_base)" | ||
pagination_strategy: | ||
type: "CursorPagination" | ||
cursor_value: "{{ response['entries'][-1]['uuid'] }}" | ||
stop_condition: "{{ not response.has_more }}" | ||
page_size: 200 | ||
page_size_option: | ||
inject_into: request_parameter | ||
field_name: per_page | ||
page_token_option: | ||
inject_into: request_parameter | ||
field_name: start-after | ||
$options: | ||
name: "activities" | ||
primary_key: "uuid" | ||
path: "/v1/activities" | ||
customer_count_stream: | ||
retriever: | ||
$ref: "*ref(definitions.retriever)" | ||
requester: | ||
$ref: "*ref(definitions.requester)" | ||
request_options_provider: | ||
request_body_data: | ||
start-date: "{{ format_datetime(config['start_date'], '%Y-%m-%d') }}" | ||
end-date: "{{ now_utc().strftime('%Y-%m-%d') }}" | ||
interval: "{{ config['interval'] }}" | ||
paginator: | ||
type: NoPagination | ||
$options: | ||
name: "customer_count" | ||
primary_key: "date" | ||
path: "/v1/metrics/customer-count" | ||
|
||
streams: | ||
- "*ref(definitions.customers_stream)" | ||
- "*ref(definitions.activities_stream)" | ||
- "*ref(definitions.customer_count_stream)" | ||
|
||
check: | ||
stream_names: | ||
- "customers" |
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.