Skip to content

Commit 7ab66a8

Browse files
authored
feat(source-woocommerce): Update CDK dependency to v4 (#43323)
1 parent 529c18f commit 7ab66a8

File tree

5 files changed

+79
-42
lines changed

5 files changed

+79
-42
lines changed

airbyte-integrations/connectors/source-woocommerce/metadata.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ data:
88
connectorSubtype: api
99
connectorType: source
1010
definitionId: 2a2552ca-9f78-4c1c-9eb7-4d0dc66d72df
11-
dockerImageTag: 0.3.1
11+
dockerImageTag: 0.4.0
1212
dockerRepository: airbyte/source-woocommerce
1313
documentationUrl: https://docs.airbyte.com/integrations/sources/woocommerce
1414
githubIssueLabel: source-woocommerce

airbyte-integrations/connectors/source-woocommerce/poetry.lock

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

airbyte-integrations/connectors/source-woocommerce/pyproject.toml

+3-3
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.3.1"
6+
version = "0.4.0"
77
name = "source-woocommerce"
88
description = "Source implementation for Woocommerce."
99
authors = [ "Airbyte <[email protected]>",]
@@ -16,8 +16,8 @@ repository = "https://github.com/airbytehq/airbyte"
1616
include = "source_woocommerce"
1717

1818
[tool.poetry.dependencies]
19-
python = "^3.9,<3.12"
20-
airbyte-cdk = "3.8.2"
19+
python = "^3.10,<3.12"
20+
airbyte-cdk = "^4"
2121

2222
[tool.poetry.scripts]
2323
source-woocommerce = "source_woocommerce.run:run"

airbyte-integrations/connectors/source-woocommerce/unit_tests/integration/test_coupons.py

+37-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
from unittest import TestCase
44

55
from airbyte_cdk.test.entrypoint_wrapper import EntrypointOutput
6-
from airbyte_cdk.test.mock_http import HttpMocker
6+
from airbyte_cdk.test.mock_http import HttpMocker, HttpResponse
77
from airbyte_protocol.models import SyncMode
8+
from freezegun import freeze_time
89

910
from .config import ConfigBuilder
1011
from .request_builder import get_coupons_request
@@ -20,6 +21,7 @@ def _read(config_: ConfigBuilder, expecting_exception: bool = False) -> Entrypoi
2021
return read_output(config_, _STREAM_NAME, SyncMode.full_refresh)
2122

2223
@HttpMocker()
24+
@freeze_time("2017-01-30T23:59:59Z")
2325
def test_read_records(self, http_mocker: HttpMocker) -> None:
2426
# Register mock response
2527
http_mocker.get(
@@ -39,3 +41,37 @@ def test_read_records(self, http_mocker: HttpMocker) -> None:
3941

4042
# Check record count
4143
assert len(output.records) == 2
44+
45+
@HttpMocker()
46+
@freeze_time("2017-02-10T00:00:00Z")
47+
def test_read_with_records_then_empty_page(self, http_mocker: HttpMocker) -> None:
48+
# Register mock response
49+
http_mocker.get(
50+
get_coupons_request()
51+
.with_param("orderby", "id")
52+
.with_param("order", "asc")
53+
.with_param("dates_are_gmt", "true")
54+
.with_param("per_page", "100")
55+
.with_param("modified_after", "2017-01-01T00:00:00")
56+
.with_param("modified_before", "2017-01-30T23:59:59")
57+
.build(),
58+
get_json_http_response("coupons.json", 200),
59+
)
60+
http_mocker.get(
61+
get_coupons_request()
62+
.with_param("orderby", "id")
63+
.with_param("order", "asc")
64+
.with_param("dates_are_gmt", "true")
65+
.with_param("per_page", "100")
66+
.with_param("modified_after", "2017-01-31T00:00:00")
67+
.with_param("modified_before", "2017-02-10T00:00:00")
68+
.build(),
69+
HttpResponse("[]", 200),
70+
)
71+
72+
# Read records
73+
output = self._read(config())
74+
75+
# Check that StopIteration is not present in logs and 2 records are returned
76+
assert all(["StopIteration" not in entry.log.message for entry in output.logs])
77+
assert len(output.records) == 2

docs/integrations/sources/woocommerce.md

+19-18
Original file line numberDiff line numberDiff line change
@@ -121,24 +121,25 @@ maximum number of seconds between API calls.
121121
<summary>Expand to review</summary>
122122

123123
| Version | Date | Pull Request | Subject |
124-
|:--------| :--------- | :------------------------------------------------------- | :--------------------------------------------------------------------- |
125-
| 0.3.1 | 2024-08-03 | [43054](https://github.com/airbytehq/airbyte/pull/43054) | Update dependencies |
126-
| 0.3.0 | 2024-07-26 | [42551](https://github.com/airbytehq/airbyte/pull/42551) | Make builder compatible |
127-
| 0.2.13 | 2024-07-27 | [42637](https://github.com/airbytehq/airbyte/pull/42637) | Update dependencies |
128-
| 0.2.12 | 2024-07-20 | [42157](https://github.com/airbytehq/airbyte/pull/42157) | Update dependencies |
129-
| 0.2.11 | 2024-07-13 | [41731](https://github.com/airbytehq/airbyte/pull/41731) | Update dependencies |
130-
| 0.2.10 | 2024-07-10 | [41581](https://github.com/airbytehq/airbyte/pull/41581) | Update dependencies |
131-
| 0.2.9 | 2024-07-09 | [41161](https://github.com/airbytehq/airbyte/pull/41161) | Update dependencies |
132-
| 0.2.8 | 2024-07-06 | [40814](https://github.com/airbytehq/airbyte/pull/40814) | Update dependencies |
133-
| 0.2.7 | 2024-06-25 | [40375](https://github.com/airbytehq/airbyte/pull/40375) | Update dependencies |
134-
| 0.2.6 | 2024-06-22 | [40094](https://github.com/airbytehq/airbyte/pull/40094) | Update dependencies |
135-
| 0.2.5 | 2024-06-06 | [39270](https://github.com/airbytehq/airbyte/pull/39270) | [autopull] Upgrade base image to v1.2.2 |
136-
| 0.2.4 | 2024-05-21 | [38544](https://github.com/airbytehq/airbyte/pull/38544) | [autopull] base image + poetry + up_to_date |
124+
|:--------| :--------- |:---------------------------------------------------------|:-----------------------------------------------------------------------|
125+
| 0.4.0 | 2024-08-06 | [43323](https://github.com/airbytehq/airbyte/pull/43323) | Update CDK to v4, Python 3.10 |
126+
| 0.3.1 | 2024-08-03 | [43054](https://github.com/airbytehq/airbyte/pull/43054) | Update dependencies |
127+
| 0.3.0 | 2024-07-26 | [42551](https://github.com/airbytehq/airbyte/pull/42551) | Make builder compatible |
128+
| 0.2.13 | 2024-07-27 | [42637](https://github.com/airbytehq/airbyte/pull/42637) | Update dependencies |
129+
| 0.2.12 | 2024-07-20 | [42157](https://github.com/airbytehq/airbyte/pull/42157) | Update dependencies |
130+
| 0.2.11 | 2024-07-13 | [41731](https://github.com/airbytehq/airbyte/pull/41731) | Update dependencies |
131+
| 0.2.10 | 2024-07-10 | [41581](https://github.com/airbytehq/airbyte/pull/41581) | Update dependencies |
132+
| 0.2.9 | 2024-07-09 | [41161](https://github.com/airbytehq/airbyte/pull/41161) | Update dependencies |
133+
| 0.2.8 | 2024-07-06 | [40814](https://github.com/airbytehq/airbyte/pull/40814) | Update dependencies |
134+
| 0.2.7 | 2024-06-25 | [40375](https://github.com/airbytehq/airbyte/pull/40375) | Update dependencies |
135+
| 0.2.6 | 2024-06-22 | [40094](https://github.com/airbytehq/airbyte/pull/40094) | Update dependencies |
136+
| 0.2.5 | 2024-06-06 | [39270](https://github.com/airbytehq/airbyte/pull/39270) | [autopull] Upgrade base image to v1.2.2 |
137+
| 0.2.4 | 2024-05-21 | [38544](https://github.com/airbytehq/airbyte/pull/38544) | [autopull] base image + poetry + up_to_date |
137138
| 0.2.3 | 2023-06-02 | [26955](https://github.com/airbytehq/airbyte/pull/26955) | Added `block_context` and `author` properties to the `Products` stream |
138-
| 0.2.2 | 2023-03-03 | [23599](https://github.com/airbytehq/airbyte/pull/23599) | Fix pagination and removed lookback window |
139-
| 0.2.1 | 2023-02-10 | [22821](https://github.com/airbytehq/airbyte/pull/22821) | Specified date formatting in specification |
140-
| 0.2.0 | 2022-11-30 | [19903](https://github.com/airbytehq/airbyte/pull/19903) | Migrate to low-code; Certification to Beta |
141-
| 0.1.1 | 2021-11-08 | [7499](https://github.com/airbytehq/airbyte/pull/7499) | Remove base-python dependencies |
142-
| 0.1.0 | 2021-09-09 | [5955](https://github.com/airbytehq/airbyte/pull/5955) | Initial Release. Source WooCommerce |
139+
| 0.2.2 | 2023-03-03 | [23599](https://github.com/airbytehq/airbyte/pull/23599) | Fix pagination and removed lookback window |
140+
| 0.2.1 | 2023-02-10 | [22821](https://github.com/airbytehq/airbyte/pull/22821) | Specified date formatting in specification |
141+
| 0.2.0 | 2022-11-30 | [19903](https://github.com/airbytehq/airbyte/pull/19903) | Migrate to low-code; Certification to Beta |
142+
| 0.1.1 | 2021-11-08 | [7499](https://github.com/airbytehq/airbyte/pull/7499) | Remove base-python dependencies |
143+
| 0.1.0 | 2021-09-09 | [5955](https://github.com/airbytehq/airbyte/pull/5955) | Initial Release. Source WooCommerce |
143144

144145
</details>

0 commit comments

Comments
 (0)