Skip to content

Commit cadb023

Browse files
[destination-convex] Switch json() to text in error handling (#42585)
Co-authored-by: Marcos Marx <[email protected]> Co-authored-by: marcosmarxm <[email protected]>
1 parent df9a5f4 commit cadb023

File tree

7 files changed

+42
-36
lines changed

7 files changed

+42
-36
lines changed

airbyte-integrations/connectors/destination-convex/README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
# Convex source connector
1+
# Convex destination connector
22

3-
4-
This is the repository for the Convex source connector, written in Python.
3+
This is the repository for the Convex destination connector, written in Python.
54
For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.com/integrations/destinations/convex).
65

76
## Local development

airbyte-integrations/connectors/destination-convex/destination_convex/client.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,6 @@ def _request(
5959
response = requests.request(method=http_method, url=url, headers=headers, json=json)
6060

6161
if response.status_code != 200:
62-
raise Exception(f"Request to {url} failed with: {response.status_code}: {response.json()}")
62+
raise Exception(f"Request to `{url}` failed with status code {response.status_code}: {response.text}")
63+
6364
return response

airbyte-integrations/connectors/destination-convex/metadata.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ data:
22
connectorType: destination
33
connectorSubtype: api
44
definitionId: 3eb4d99c-11fa-4561-a259-fc88e0c2f8f4
5-
dockerImageTag: 0.2.6
5+
dockerImageTag: 0.2.7
66
dockerRepository: airbyte/destination-convex
77
githubIssueLabel: destination-convex
88
icon: convex.svg

airbyte-integrations/connectors/destination-convex/poetry.lock

+21-20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

airbyte-integrations/connectors/destination-convex/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",]
33
build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
6-
version = "0.2.6"
6+
version = "0.2.7"
77
name = "destination-convex"
88
description = "Destination implementation for Convex."
99
authors = [ "Airbyte <[email protected]>",]

airbyte-integrations/connectors/destination-convex/unit_tests/unit_test.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def setup_bad_response(config):
9898
responses.PUT,
9999
f"{config['deployment_url']}/api/streaming_import/clear_tables",
100100
status=400,
101-
json={"code": "ErrorCode", "message": "error message"},
101+
body="error message",
102102
)
103103

104104

@@ -108,7 +108,11 @@ def test_bad_write(config: ConvexConfig, configured_catalog: ConfiguredAirbyteCa
108108
client = ConvexClient(config, {})
109109
with pytest.raises(Exception) as e:
110110
client.delete([])
111-
assert "/api/streaming_import/clear_tables failed with: 400: {'code': 'ErrorCode', 'message': 'error message'}" in str(e.value)
111+
112+
assert (
113+
"Request to `http://deployment_url.convex.cloud/api/streaming_import/clear_tables` failed with status code 400: error message"
114+
in str(e.value)
115+
)
112116

113117

114118
@responses.activate

docs/integrations/destinations/convex.md

+9-8
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,14 @@ On the [Convex dashboard](https://dashboard.convex.dev/), navigate to the projec
5757

5858
| Version | Date | Pull Request | Subject |
5959
| :------ | :--------- | :------------------------------------------------------- | :---------------------------------------------------------------- |
60-
| 0.2.6 | 2024-07-09 | [41275](https://github.com/airbytehq/airbyte/pull/41275) | Update dependencies |
61-
| 0.2.5 | 2024-07-06 | [40987](https://github.com/airbytehq/airbyte/pull/40987) | Update dependencies |
62-
| 0.2.4 | 2024-06-25 | [40496](https://github.com/airbytehq/airbyte/pull/40496) | Update dependencies |
63-
| 0.2.3 | 2024-06-22 | [40122](https://github.com/airbytehq/airbyte/pull/40122) | Update dependencies |
64-
| 0.2.2 | 2024-06-04 | [39083](https://github.com/airbytehq/airbyte/pull/39083) | [autopull] Upgrade base image to v1.2.1 |
65-
| 0.2.1 | 2024-05-21 | [38527](https://github.com/airbytehq/airbyte/pull/38527) | [autopull] base image + poetry + up_to_date |
66-
| 0.2.0 | 2023-05-15 | [26103](https://github.com/airbytehq/airbyte/pull/26103) | 🐛 Update Convex destination connector to fix overwrite sync mode |
67-
| 0.1.0 | 2023-01-05 | [21287](https://github.com/airbytehq/airbyte/pull/21287) | 🎉 New Destination: Convex |
60+
| 0.2.7 | 2024-07-31 | [42585](https://github.com/airbytehq/airbyte/pull/42585) | Improve error handling |
61+
| 0.2.6 | 2024-07-09 | [41275](https://github.com/airbytehq/airbyte/pull/41275) | Update dependencies |
62+
| 0.2.5 | 2024-07-06 | [40987](https://github.com/airbytehq/airbyte/pull/40987) | Update dependencies |
63+
| 0.2.4 | 2024-06-25 | [40496](https://github.com/airbytehq/airbyte/pull/40496) | Update dependencies |
64+
| 0.2.3 | 2024-06-22 | [40122](https://github.com/airbytehq/airbyte/pull/40122) | Update dependencies |
65+
| 0.2.2 | 2024-06-04 | [39083](https://github.com/airbytehq/airbyte/pull/39083) | [autopull] Upgrade base image to v1.2.1 |
66+
| 0.2.1 | 2024-05-21 | [38527](https://github.com/airbytehq/airbyte/pull/38527) | [autopull] base image + poetry + up_to_date |
67+
| 0.2.0 | 2023-05-15 | [26103](https://github.com/airbytehq/airbyte/pull/26103) | 🐛 Update Convex destination connector to fix overwrite sync mode |
68+
| 0.1.0 | 2023-01-05 | [21287](https://github.com/airbytehq/airbyte/pull/21287) | 🎉 New Destination: Convex |
6869

6970
</details>

0 commit comments

Comments
 (0)