Skip to content

Commit 7ffcd3d

Browse files
authored
feat(source-shopify): update CDK to v5 (#45190)
Signed-off-by: Artem Inzhyyants <[email protected]>
1 parent f216a60 commit 7ffcd3d

File tree

11 files changed

+441
-203
lines changed

11 files changed

+441
-203
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ data:
1111
connectorSubtype: api
1212
connectorType: source
1313
definitionId: 9da77001-af33-4bcd-be46-6252bf9342b9
14-
dockerImageTag: 2.4.24
14+
dockerImageTag: 2.5.0
1515
dockerRepository: airbyte/source-shopify
1616
documentationUrl: https://docs.airbyte.com/integrations/sources/shopify
1717
erdUrl: https://dbdocs.io/airbyteio/source-shopify?view=relationships

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

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

airbyte-integrations/connectors/source-shopify/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 = "2.4.24"
6+
version = "2.5.0"
77
name = "source-shopify"
88
description = "Source CDK implementation for Shopify."
99
authors = [ "Airbyte <[email protected]>",]
@@ -16,8 +16,8 @@ repository = "https://github.com/airbytehq/airbyte"
1616
include = "source_shopify"
1717

1818
[tool.poetry.dependencies]
19-
python = "^3.9,<3.12"
20-
airbyte-cdk = "^3"
19+
python = "^3.10,<3.12"
20+
airbyte-cdk = "^5"
2121
sgqlc = "==16.3"
2222
graphql-query = "^1"
2323

airbyte-integrations/connectors/source-shopify/source_shopify/config_migrations.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77

88
from airbyte_cdk.config_observation import create_connector_config_control_message
99
from airbyte_cdk.entrypoint import AirbyteEntrypoint
10+
from airbyte_cdk.models import AirbyteMessageSerializer
1011
from airbyte_cdk.sources import Source
1112
from airbyte_cdk.sources.message import InMemoryMessageRepository, MessageRepository
13+
from orjson import orjson
1214

1315

1416
class MigrateConfig:
@@ -72,7 +74,7 @@ def emit_control_message(cls, migrated_config: Mapping[str, Any]) -> None:
7274
cls.message_repository.emit_message(create_connector_config_control_message(migrated_config))
7375
# emit the Airbyte Control Message from message queue to stdout
7476
for message in cls.message_repository._message_queue:
75-
print(message.json(exclude_unset=True))
77+
print(orjson.dumps(AirbyteMessageSerializer.dump(message)).decode())
7678

7779
@classmethod
7880
def migrate(cls, args: List[str], source: Source) -> None:

airbyte-integrations/connectors/source-shopify/source_shopify/http_request.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
from typing import Optional, Union
44

55
import requests
6+
from airbyte_cdk.models import FailureType
67
from airbyte_cdk.sources.streams.http.error_handlers import ErrorHandler, ErrorResolution, ResponseAction
7-
from airbyte_protocol.models import FailureType
88
from requests import exceptions
99

1010
RESPONSE_CONSUMPTION_EXCEPTIONS = (

airbyte-integrations/connectors/source-shopify/source_shopify/shopify_graphql/bulk/exceptions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#
44

55

6+
from airbyte_cdk.models import FailureType
67
from airbyte_cdk.utils import AirbyteTracedException
7-
from airbyte_protocol.models import FailureType
88

99

1010
class ShopifyBulkExceptions:

airbyte-integrations/connectors/source-shopify/source_shopify/streams/base_streams.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212

1313
import pendulum as pdm
1414
import requests
15+
from airbyte_cdk.models import SyncMode
1516
from airbyte_cdk.sources.streams.core import StreamData
1617
from airbyte_cdk.sources.streams.http import HttpClient, HttpStream
1718
from airbyte_cdk.sources.streams.http.error_handlers import ErrorHandler, HttpStatusErrorHandler
1819
from airbyte_cdk.sources.streams.http.error_handlers.default_error_mapping import DEFAULT_ERROR_MAPPING
19-
from airbyte_protocol.models import SyncMode
2020
from requests.exceptions import RequestException
2121
from source_shopify.http_request import ShopifyErrorHandler
2222
from source_shopify.shopify_graphql.bulk.job import ShopifyBulkManager

airbyte-integrations/connectors/source-shopify/source_shopify/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
from typing import Any, Callable, Dict, List, Mapping, Optional
1111

1212
import requests
13+
from airbyte_cdk.models import FailureType
1314
from airbyte_cdk.sources.streams.http.error_handlers.response_models import ErrorResolution, ResponseAction
1415
from airbyte_cdk.utils import AirbyteTracedException
15-
from airbyte_protocol.models import FailureType
1616

1717

1818
class ShopifyNonRetryableErrors:

airbyte-integrations/connectors/source-shopify/unit_tests/graphql_bulk/test_job.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import pytest
99
import requests
10-
from airbyte_protocol.models import SyncMode
10+
from airbyte_cdk.models import SyncMode
1111
from source_shopify.shopify_graphql.bulk.exceptions import ShopifyBulkExceptions
1212
from source_shopify.shopify_graphql.bulk.status import ShopifyBulkJobStatus
1313
from source_shopify.streams.streams import (

airbyte-integrations/connectors/source-shopify/unit_tests/integration/test_bulk_stream.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from airbyte_cdk.test.mock_http import HttpMocker, HttpRequest, HttpResponse
1010

1111
_AN_ERROR_RESPONSE = HttpResponse(json.dumps({"errors": ["an error"]}))
12-
from airbyte_protocol.models import SyncMode
12+
from airbyte_cdk.models import SyncMode
1313
from freezegun import freeze_time
1414
from requests.exceptions import ConnectionError
1515
from source_shopify import SourceShopify

docs/integrations/sources/shopify.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,8 @@ For all `Shopify GraphQL BULK` api requests these limitations are applied: https
234234

235235
| Version | Date | Pull Request | Subject |
236236
|:--------|:-----------|:---------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
237-
| 2.4.24 | 2024-09-03 | [45116](https://github.com/airbytehq/airbyte/pull/45116) | Have message and description be nullable for custom_collections deleted events |
237+
| 2.5.0 | 2024-09-06 | [45190](https://github.com/airbytehq/airbyte/pull/45190) | Migrate to CDK v5 |
238+
| 2.4.24 | 2024-09-03 | [45116](https://github.com/airbytehq/airbyte/pull/45116) | Have message and description be nullable for custom_collections deleted events |
238239
| 2.4.23 | 2024-08-31 | [44971](https://github.com/airbytehq/airbyte/pull/44971) | Update dependencies |
239240
| 2.4.22 | 2024-08-24 | [44723](https://github.com/airbytehq/airbyte/pull/44723) | Update dependencies |
240241
| 2.4.21 | 2024-08-17 | [44318](https://github.com/airbytehq/airbyte/pull/44318) | Update dependencies |
@@ -302,13 +303,13 @@ For all `Shopify GraphQL BULK` api requests these limitations are applied: https
302303
| 0.1.39 | 2022-10-13 | [17962](https://github.com/airbytehq/airbyte/pull/17962) | Added metafield streams; support for nested list streams |
303304
| 0.1.38 | 2022-10-10 | [17777](https://github.com/airbytehq/airbyte/pull/17777) | Fixed `404` for configured streams, fix missing `cursor` error for old records |
304305
| 0.1.37 | 2022-04-30 | [12500](https://github.com/airbytehq/airbyte/pull/12500) | Improve input configuration copy |
305-
| 0.1.36 | 2022-03-22 | [9850](https://github.com/airbytehq/airbyte/pull/9850) | Added `BalanceTransactions` stream |
306+
| 0.1.36 | 2022-03-22 | [9850](https://github.com/airbytehq/airbyte/pull/9850) | Added `BalanceTransactions` stream |
306307
| 0.1.35 | 2022-03-07 | [10915](https://github.com/airbytehq/airbyte/pull/10915) | Fixed a bug which caused `full-refresh` syncs of child REST entities configured for `incremental` |
307308
| 0.1.34 | 2022-03-02 | [10794](https://github.com/airbytehq/airbyte/pull/10794) | Minor specification re-order, fixed links in documentation |
308309
| 0.1.33 | 2022-02-17 | [10419](https://github.com/airbytehq/airbyte/pull/10419) | Fixed wrong field type for tax_exemptions for `Abandoned_checkouts` stream |
309310
| 0.1.32 | 2022-02-18 | [10449](https://github.com/airbytehq/airbyte/pull/10449) | Added `tender_transactions` stream |
310311
| 0.1.31 | 2022-02-08 | [10175](https://github.com/airbytehq/airbyte/pull/10175) | Fixed compatibility issues for legacy user config |
311-
| 0.1.30 | 2022-01-24 | [9648](https://github.com/airbytehq/airbyte/pull/9648) | Added permission validation before sync |
312+
| 0.1.30 | 2022-01-24 | [9648](https://github.com/airbytehq/airbyte/pull/9648) | Added permission validation before sync |
312313
| 0.1.29 | 2022-01-20 | [9049](https://github.com/airbytehq/airbyte/pull/9248) | Added `shop_url` to the record for all streams |
313314
| 0.1.28 | 2022-01-19 | [9591](https://github.com/airbytehq/airbyte/pull/9591) | Implemented `OAuth2.0` authentication method for Airbyte Cloud |
314315
| 0.1.27 | 2021-12-22 | [9049](https://github.com/airbytehq/airbyte/pull/9049) | Updated connector fields title/description |

0 commit comments

Comments
 (0)