Skip to content

Commit

Permalink
feat(source-woocommerce): Update CDK dependency to v4 (#43323)
Browse files Browse the repository at this point in the history
  • Loading branch information
strosek authored Aug 6, 2024
1 parent 529c18f commit 7ab66a8
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ data:
connectorSubtype: api
connectorType: source
definitionId: 2a2552ca-9f78-4c1c-9eb7-4d0dc66d72df
dockerImageTag: 0.3.1
dockerImageTag: 0.4.0
dockerRepository: airbyte/source-woocommerce
documentationUrl: https://docs.airbyte.com/integrations/sources/woocommerce
githubIssueLabel: source-woocommerce
Expand Down
38 changes: 19 additions & 19 deletions airbyte-integrations/connectors/source-woocommerce/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
version = "0.3.1"
version = "0.4.0"
name = "source-woocommerce"
description = "Source implementation for Woocommerce."
authors = [ "Airbyte <[email protected]>",]
Expand All @@ -16,8 +16,8 @@ repository = "https://github.com/airbytehq/airbyte"
include = "source_woocommerce"

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

[tool.poetry.scripts]
source-woocommerce = "source_woocommerce.run:run"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
from unittest import TestCase

from airbyte_cdk.test.entrypoint_wrapper import EntrypointOutput
from airbyte_cdk.test.mock_http import HttpMocker
from airbyte_cdk.test.mock_http import HttpMocker, HttpResponse
from airbyte_protocol.models import SyncMode
from freezegun import freeze_time

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

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

# Check record count
assert len(output.records) == 2

@HttpMocker()
@freeze_time("2017-02-10T00:00:00Z")
def test_read_with_records_then_empty_page(self, http_mocker: HttpMocker) -> None:
# Register mock response
http_mocker.get(
get_coupons_request()
.with_param("orderby", "id")
.with_param("order", "asc")
.with_param("dates_are_gmt", "true")
.with_param("per_page", "100")
.with_param("modified_after", "2017-01-01T00:00:00")
.with_param("modified_before", "2017-01-30T23:59:59")
.build(),
get_json_http_response("coupons.json", 200),
)
http_mocker.get(
get_coupons_request()
.with_param("orderby", "id")
.with_param("order", "asc")
.with_param("dates_are_gmt", "true")
.with_param("per_page", "100")
.with_param("modified_after", "2017-01-31T00:00:00")
.with_param("modified_before", "2017-02-10T00:00:00")
.build(),
HttpResponse("[]", 200),
)

# Read records
output = self._read(config())

# Check that StopIteration is not present in logs and 2 records are returned
assert all(["StopIteration" not in entry.log.message for entry in output.logs])
assert len(output.records) == 2
37 changes: 19 additions & 18 deletions docs/integrations/sources/woocommerce.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,24 +121,25 @@ maximum number of seconds between API calls.
<summary>Expand to review</summary>

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

</details>

0 comments on commit 7ab66a8

Please sign in to comment.