Skip to content

Commit

Permalink
šŸ› Source Braintree: catch client initialization error in check_connecā€¦
Browse files Browse the repository at this point in the history
ā€¦tion method (#26340)

* Update acceptance-test-config to conform to new schema

* Catch client initialization error in check_connection method

* iterate version
  • Loading branch information
keurcien committed May 24, 2023
1 parent 63f7fc0 commit e12daa7
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ RUN pip install .
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.1.4
LABEL io.airbyte.version=0.1.5
LABEL io.airbyte.name=airbyte/source-braintree
Original file line number Diff line number Diff line change
@@ -1,27 +1,35 @@
connector_image: airbyte/source-braintree:dev
tests:
acceptance_tests:
spec:
- spec_path: "integration_tests/spec.json"
tests:
- spec_path: integration_tests/spec.json
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: ["subscription_stream"]
expect_records:
path: "integration_tests/expected_records.jsonl"
extra_fields: no
exact_order: no
extra_records: yes
tests:
- config_path: secrets/config.json
empty_streams:
- name: subscription_stream
bypass_reason: "No subscription in the test account"
expect_records:
path: integration_tests/expected_records.jsonl
extra_fields: no
exact_order: no
extra_records: yes
incremental:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog_incremental.json"
future_state_path: "integration_tests/abnormal_state.json"
tests:
- config_path: secrets/config.json
configured_catalog_path: integration_tests/configured_catalog_incremental.json
future_state:
future_state_path: integration_tests/abnormal_state.json
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ data:
connectorSubtype: api
connectorType: source
definitionId: 63cea06f-1c75-458d-88fe-ad48c7cb27fd
dockerImageTag: 0.1.4
dockerImageTag: 0.1.5
dockerRepository: airbyte/source-braintree
githubIssueLabel: source-braintree
icon: braintree.svg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ def check_connection(self, logger: AirbyteLogger, config: Mapping[str, Any]) ->
"""
:return: AirbyteConnectionStatus indicating a Success or Failure
"""
config = BraintreeConfig(**config)
gateway = BraintreeStream.create_gateway(config)
gateway.customer.all()
try:
config = BraintreeConfig(**config)
gateway = BraintreeStream.create_gateway(config)
gateway.customer.all()
except Exception as exc:
return False, repr(exc)

return True, ""

def streams(self, config: Mapping[str, Any]) -> List[Stream]:
Expand Down
1 change: 1 addition & 0 deletions docs/integrations/sources/braintree.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ The Braintree connector should not run into Braintree API limitations under norm

| Version | Date | Pull Request | Subject |
| :--- | :--- | :--- | :--- |
| 0.1.5 | 2023-05-24 | [26340](https://github.com/airbytehq/airbyte/pull/26340) | Fix error in `check_connection` in integration tests |
| 0.1.4 | 2023-03-13 | [23548](https://github.com/airbytehq/airbyte/pull/23548) | Update braintree python library version to 4.18.1 |
| 0.1.3 | 2021-12-23 | [8434](https://github.com/airbytehq/airbyte/pull/8434) | Update fields in source-connectors specifications |
| 0.1.2 | 2021-12-22 | [9042](https://github.com/airbytehq/airbyte/pull/9042) | Fix `$ref` in schema and spec |
Expand Down

0 comments on commit e12daa7

Please sign in to comment.