airbyte-source-shopify 2.5.12.dev202412101009__tar.gz → 2.5.14__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/PKG-INFO +2 -2
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/pyproject.toml +2 -2
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/auth.py +0 -1
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/config_migrations.py +2 -1
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/http_request.py +3 -1
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/scopes.py +3 -2
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/shopify_graphql/bulk/exceptions.py +5 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/shopify_graphql/bulk/job.py +41 -5
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/shopify_graphql/bulk/query.py +0 -1
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/shopify_graphql/bulk/retry.py +1 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/shopify_graphql/bulk/tools.py +1 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/shopify_graphql/graphql.py +1 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/shopify_graphql/schema.py +1 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/source.py +2 -1
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/spec.json +2 -2
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/streams/base_streams.py +6 -5
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/utils.py +3 -1
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/README.md +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/__init__.py +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/run.py +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/abandoned_checkouts.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/articles.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/balance_transactions.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/blogs.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/collections.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/collects.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/countries.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/custom_collections.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/customer_address.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/customer_journey_summary.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/customer_saved_search.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/customers.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/discount_codes.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/disputes.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/draft_orders.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/fulfillment_orders.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/fulfillments.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/inventory_items.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/inventory_levels.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/locations.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/metafield_articles.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/metafield_blogs.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/metafield_collections.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/metafield_customers.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/metafield_draft_orders.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/metafield_locations.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/metafield_orders.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/metafield_pages.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/metafield_product_images.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/metafield_product_variants.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/metafield_products.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/metafield_shops.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/metafield_smart_collections.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/order_agreements.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/order_refunds.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/order_risks.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/orders.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/pages.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/price_rules.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/product_images.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/product_variants.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/products.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/products_graph_ql.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/shop.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/smart_collections.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/tender_transactions.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/schemas/transactions.json +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/shopify_graphql/bulk/__init__.py +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/shopify_graphql/bulk/record.py +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/shopify_graphql/bulk/status.py +0 -0
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/streams/streams.py +3 -3
- {airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/source_shopify/transform.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: airbyte-source-shopify
|
|
3
|
-
Version: 2.5.
|
|
3
|
+
Version: 2.5.14
|
|
4
4
|
Summary: Source CDK implementation for Shopify.
|
|
5
5
|
Home-page: https://airbyte.com
|
|
6
6
|
License: ELv2
|
|
@@ -11,7 +11,7 @@ Classifier: License :: Other/Proprietary License
|
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
-
Requires-Dist: airbyte-cdk (>=
|
|
14
|
+
Requires-Dist: airbyte-cdk (>=6,<7)
|
|
15
15
|
Requires-Dist: graphql-query (>=1,<2)
|
|
16
16
|
Requires-Dist: sgqlc (==16.3)
|
|
17
17
|
Project-URL: Documentation, https://docs.airbyte.com/integrations/sources/shopify
|
{airbyte_source_shopify-2.5.12.dev202412101009 → airbyte_source_shopify-2.5.14}/pyproject.toml
RENAMED
|
@@ -5,7 +5,7 @@ requires = [
|
|
|
5
5
|
build-backend = "poetry.core.masonry.api"
|
|
6
6
|
|
|
7
7
|
[tool.poetry]
|
|
8
|
-
version = "2.5.
|
|
8
|
+
version = "2.5.14"
|
|
9
9
|
name = "airbyte-source-shopify"
|
|
10
10
|
description = "Source CDK implementation for Shopify."
|
|
11
11
|
authors = [
|
|
@@ -22,7 +22,7 @@ packages = [
|
|
|
22
22
|
|
|
23
23
|
[tool.poetry.dependencies]
|
|
24
24
|
python = "^3.10,<3.12"
|
|
25
|
-
airbyte-cdk = "^
|
|
25
|
+
airbyte-cdk = "^6"
|
|
26
26
|
sgqlc = "==16.3"
|
|
27
27
|
graphql-query = "^1"
|
|
28
28
|
|
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
|
|
6
6
|
from typing import Any, List, Mapping
|
|
7
7
|
|
|
8
|
+
from orjson import orjson
|
|
9
|
+
|
|
8
10
|
from airbyte_cdk.config_observation import create_connector_config_control_message
|
|
9
11
|
from airbyte_cdk.entrypoint import AirbyteEntrypoint
|
|
10
12
|
from airbyte_cdk.models import AirbyteMessageSerializer
|
|
11
13
|
from airbyte_cdk.sources import Source
|
|
12
14
|
from airbyte_cdk.sources.message import InMemoryMessageRepository, MessageRepository
|
|
13
|
-
from orjson import orjson
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
class MigrateConfig:
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
from typing import Optional, Union
|
|
4
4
|
|
|
5
5
|
import requests
|
|
6
|
+
from requests import exceptions
|
|
7
|
+
|
|
6
8
|
from airbyte_cdk.models import FailureType
|
|
7
9
|
from airbyte_cdk.sources.streams.http.error_handlers import ErrorHandler, ErrorResolution, ResponseAction
|
|
8
|
-
|
|
10
|
+
|
|
9
11
|
|
|
10
12
|
RESPONSE_CONSUMPTION_EXCEPTIONS = (
|
|
11
13
|
exceptions.ChunkedEncodingError,
|
|
@@ -7,12 +7,14 @@ import logging
|
|
|
7
7
|
from typing import Any, Iterable, List, Mapping, Optional
|
|
8
8
|
|
|
9
9
|
import requests
|
|
10
|
-
from airbyte_cdk.sources.streams.http import HttpClient
|
|
11
10
|
from requests.exceptions import InvalidURL, JSONDecodeError
|
|
12
11
|
|
|
12
|
+
from airbyte_cdk.sources.streams.http import HttpClient
|
|
13
|
+
|
|
13
14
|
from .http_request import ShopifyErrorHandler
|
|
14
15
|
from .utils import ShopifyAccessScopesError, ShopifyBadJsonError, ShopifyWrongShopNameError
|
|
15
16
|
|
|
17
|
+
|
|
16
18
|
SCOPES_MAPPING: Mapping[str, set[str]] = {
|
|
17
19
|
# SCOPE: read_customers
|
|
18
20
|
"Customers": ("read_customers",),
|
|
@@ -82,7 +84,6 @@ ALWAYS_PERMITTED_STREAMS: List[str] = [
|
|
|
82
84
|
|
|
83
85
|
|
|
84
86
|
class ShopifyScopes:
|
|
85
|
-
|
|
86
87
|
# define default logger
|
|
87
88
|
logger = logging.getLogger("airbyte")
|
|
88
89
|
|
|
@@ -52,6 +52,11 @@ class ShopifyBulkExceptions:
|
|
|
52
52
|
|
|
53
53
|
failure_type: FailureType = FailureType.transient_error
|
|
54
54
|
|
|
55
|
+
class BulkJobCheckpointCollisionError(BaseBulkException):
|
|
56
|
+
"""Raised when an attempt to create a job using the `checkpointed cursor` value goes into inf.loop."""
|
|
57
|
+
|
|
58
|
+
failure_type: FailureType = FailureType.transient_error
|
|
59
|
+
|
|
55
60
|
class BulkJobRedirectToOtherShopError(BaseBulkException):
|
|
56
61
|
"""Raised when the response contains another shop name"""
|
|
57
62
|
|
|
@@ -9,11 +9,12 @@ from typing import Any, Final, Iterable, List, Mapping, Optional
|
|
|
9
9
|
|
|
10
10
|
import pendulum as pdm
|
|
11
11
|
import requests
|
|
12
|
-
from airbyte_cdk.sources.streams.http import HttpClient
|
|
13
12
|
from requests.exceptions import JSONDecodeError
|
|
14
13
|
from source_shopify.utils import LOGGER, ApiTypeEnum
|
|
15
14
|
from source_shopify.utils import ShopifyRateLimiter as limiter
|
|
16
15
|
|
|
16
|
+
from airbyte_cdk.sources.streams.http import HttpClient
|
|
17
|
+
|
|
17
18
|
from .exceptions import AirbyteTracedException, ShopifyBulkExceptions
|
|
18
19
|
from .query import ShopifyBulkQuery, ShopifyBulkTemplates
|
|
19
20
|
from .record import ShopifyBulkRecord
|
|
@@ -53,7 +54,7 @@ class ShopifyBulkManager:
|
|
|
53
54
|
|
|
54
55
|
# currents: _job_id, _job_state, _job_created_at, _job_self_canceled
|
|
55
56
|
_job_id: Optional[str] = field(init=False, default=None)
|
|
56
|
-
_job_state: str = field(init=False, default=None) # this string is based on ShopifyBulkJobStatus
|
|
57
|
+
_job_state: str | None = field(init=False, default=None) # this string is based on ShopifyBulkJobStatus
|
|
57
58
|
# completed and saved Bulk Job result filename
|
|
58
59
|
_job_result_filename: Optional[str] = field(init=False, default=None)
|
|
59
60
|
# date-time when the Bulk Job was created on the server
|
|
@@ -70,6 +71,8 @@ class ShopifyBulkManager:
|
|
|
70
71
|
_job_last_rec_count: int = field(init=False, default=0)
|
|
71
72
|
# the flag to adjust the next slice from the checkpointed cursor vaue
|
|
72
73
|
_job_adjust_slice_from_checkpoint: bool = field(init=False, default=False)
|
|
74
|
+
# keeps the last checkpointed cursor value for supported streams
|
|
75
|
+
_job_last_checkpoint_cursor_value: str | None = field(init=False, default=None)
|
|
73
76
|
|
|
74
77
|
# expand slice factor
|
|
75
78
|
_job_size_expand_factor: int = field(init=False, default=2)
|
|
@@ -209,6 +212,27 @@ class ShopifyBulkManager:
|
|
|
209
212
|
# reseting the checkpoint flag, if bulk job has completed normally
|
|
210
213
|
self._job_adjust_slice_from_checkpoint = False
|
|
211
214
|
|
|
215
|
+
def _set_last_checkpoint_cursor_value(self, checkpointed_cursor: str) -> None:
|
|
216
|
+
"""
|
|
217
|
+
Sets the last checkpoint cursor value.
|
|
218
|
+
|
|
219
|
+
Args:
|
|
220
|
+
checkpointed_cursor (str): The cursor value to set as the last checkpoint. Defaults to None.
|
|
221
|
+
"""
|
|
222
|
+
self._job_last_checkpoint_cursor_value = checkpointed_cursor
|
|
223
|
+
|
|
224
|
+
def _checkpoint_cursor_has_collision(self, checkpointed_cursor: str) -> bool:
|
|
225
|
+
"""
|
|
226
|
+
Checks if the provided checkpointed cursor collides with the last checkpointed cursor value.
|
|
227
|
+
|
|
228
|
+
Args:
|
|
229
|
+
checkpointed_cursor (str): The cursor value to check for collision. Defaults to None.
|
|
230
|
+
|
|
231
|
+
Returns:
|
|
232
|
+
bool: True if the provided cursor collides with the last checkpointed cursor value, False otherwise.
|
|
233
|
+
"""
|
|
234
|
+
return self._job_last_checkpoint_cursor_value == checkpointed_cursor
|
|
235
|
+
|
|
212
236
|
def _job_completed(self) -> bool:
|
|
213
237
|
return self._job_state == ShopifyBulkJobStatus.COMPLETED.value
|
|
214
238
|
|
|
@@ -329,7 +353,7 @@ class ShopifyBulkManager:
|
|
|
329
353
|
def _on_completed_job(self, response: Optional[requests.Response] = None) -> None:
|
|
330
354
|
self._job_result_filename = self._job_get_result(response)
|
|
331
355
|
|
|
332
|
-
def _on_failed_job(self, response: requests.Response) -> AirbyteTracedException:
|
|
356
|
+
def _on_failed_job(self, response: requests.Response) -> AirbyteTracedException | None:
|
|
333
357
|
if not self._supports_checkpointing:
|
|
334
358
|
raise ShopifyBulkExceptions.BulkJobFailed(
|
|
335
359
|
f"The BULK Job: `{self._job_id}` exited with {self._job_state}, details: {response.text}",
|
|
@@ -485,7 +509,7 @@ class ShopifyBulkManager:
|
|
|
485
509
|
self._job_state = ShopifyBulkJobStatus.CREATED.value
|
|
486
510
|
LOGGER.info(f"Stream: `{self.http_client.name}`, the BULK Job: `{self._job_id}` is {ShopifyBulkJobStatus.CREATED.value}")
|
|
487
511
|
|
|
488
|
-
def job_size_normalize(self, start: datetime, end: datetime) ->
|
|
512
|
+
def job_size_normalize(self, start: datetime, end: datetime) -> None:
|
|
489
513
|
# adjust slice size when it's bigger than the loop point when it should end,
|
|
490
514
|
# to preserve correct job size adjustments when this is the only job we need to run, based on STATE provided
|
|
491
515
|
requested_slice_size = (end - start).total_days()
|
|
@@ -498,8 +522,20 @@ class ShopifyBulkManager:
|
|
|
498
522
|
def _adjust_slice_end(self, slice_end: datetime, checkpointed_cursor: Optional[str] = None) -> datetime:
|
|
499
523
|
"""
|
|
500
524
|
Choose between the existing `slice_end` value or `checkpointed_cursor` value, if provided.
|
|
525
|
+
|
|
526
|
+
Optionally: raises the `transient` error if the checkpoint collision occurs.
|
|
501
527
|
"""
|
|
502
|
-
|
|
528
|
+
|
|
529
|
+
if checkpointed_cursor:
|
|
530
|
+
if self._checkpoint_cursor_has_collision(checkpointed_cursor):
|
|
531
|
+
raise ShopifyBulkExceptions.BulkJobCheckpointCollisionError(
|
|
532
|
+
f"The stream: `{self.http_client.name}` checkpoint collision is detected. Try to increase the `BULK Job checkpoint (rows collected)` to the bigger value. The stream will be synced again during the next sync attempt."
|
|
533
|
+
)
|
|
534
|
+
# set the checkpointed cursor value
|
|
535
|
+
self._set_last_checkpoint_cursor_value(checkpointed_cursor)
|
|
536
|
+
return pdm.parse(checkpointed_cursor)
|
|
537
|
+
|
|
538
|
+
return slice_end
|
|
503
539
|
|
|
504
540
|
def get_adjusted_job_end(self, slice_start: datetime, slice_end: datetime, checkpointed_cursor: Optional[str] = None) -> datetime:
|
|
505
541
|
if self._job_adjust_slice_from_checkpoint:
|
|
@@ -2562,7 +2562,6 @@ class ProductVariant(ShopifyBulkQuery):
|
|
|
2562
2562
|
|
|
2563
2563
|
@property
|
|
2564
2564
|
def query_nodes(self) -> Optional[Union[List[Field], List[str]]]:
|
|
2565
|
-
|
|
2566
2565
|
prices_fields: List[str] = ["amount", "currencyCode"]
|
|
2567
2566
|
presentment_prices_fields: List[Field] = [
|
|
2568
2567
|
Field(
|
|
@@ -6,11 +6,12 @@
|
|
|
6
6
|
import logging
|
|
7
7
|
from typing import Any, List, Mapping, Tuple
|
|
8
8
|
|
|
9
|
+
from requests.exceptions import ConnectionError, RequestException, SSLError
|
|
10
|
+
|
|
9
11
|
from airbyte_cdk.models import FailureType, SyncMode
|
|
10
12
|
from airbyte_cdk.sources import AbstractSource
|
|
11
13
|
from airbyte_cdk.sources.streams import Stream
|
|
12
14
|
from airbyte_cdk.utils import AirbyteTracedException
|
|
13
|
-
from requests.exceptions import ConnectionError, RequestException, SSLError
|
|
14
15
|
|
|
15
16
|
from .auth import MissingAccessTokenError, ShopifyAuthenticator
|
|
16
17
|
from .scopes import ShopifyScopes
|
|
@@ -115,10 +115,10 @@
|
|
|
115
115
|
"job_checkpoint_interval": {
|
|
116
116
|
"type": "integer",
|
|
117
117
|
"title": "BULK Job checkpoint (rows collected)",
|
|
118
|
-
"description": "The threshold, after which the single BULK Job should be checkpointed
|
|
118
|
+
"description": "The threshold, after which the single BULK Job should be checkpointed (min: 15k, max: 1M)",
|
|
119
119
|
"default": 100000,
|
|
120
120
|
"minimum": 15000,
|
|
121
|
-
"maximum":
|
|
121
|
+
"maximum": 1000000
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
},
|
|
@@ -12,11 +12,6 @@ from urllib.parse import parse_qsl, urlparse
|
|
|
12
12
|
|
|
13
13
|
import pendulum as pdm
|
|
14
14
|
import requests
|
|
15
|
-
from airbyte_cdk.models import SyncMode
|
|
16
|
-
from airbyte_cdk.sources.streams.core import StreamData
|
|
17
|
-
from airbyte_cdk.sources.streams.http import HttpClient, HttpStream
|
|
18
|
-
from airbyte_cdk.sources.streams.http.error_handlers import ErrorHandler, HttpStatusErrorHandler
|
|
19
|
-
from airbyte_cdk.sources.streams.http.error_handlers.default_error_mapping import DEFAULT_ERROR_MAPPING
|
|
20
15
|
from requests.exceptions import RequestException
|
|
21
16
|
from source_shopify.http_request import ShopifyErrorHandler
|
|
22
17
|
from source_shopify.shopify_graphql.bulk.job import ShopifyBulkManager
|
|
@@ -26,6 +21,12 @@ from source_shopify.utils import EagerlyCachedStreamState as stream_state_cache
|
|
|
26
21
|
from source_shopify.utils import ShopifyNonRetryableErrors
|
|
27
22
|
from source_shopify.utils import ShopifyRateLimiter as limiter
|
|
28
23
|
|
|
24
|
+
from airbyte_cdk.models import SyncMode
|
|
25
|
+
from airbyte_cdk.sources.streams.core import StreamData
|
|
26
|
+
from airbyte_cdk.sources.streams.http import HttpClient, HttpStream
|
|
27
|
+
from airbyte_cdk.sources.streams.http.error_handlers import ErrorHandler, HttpStatusErrorHandler
|
|
28
|
+
from airbyte_cdk.sources.streams.http.error_handlers.default_error_mapping import DEFAULT_ERROR_MAPPING
|
|
29
|
+
|
|
29
30
|
|
|
30
31
|
class ShopifyStream(HttpStream, ABC):
|
|
31
32
|
# define default logger
|
|
@@ -10,10 +10,12 @@ from time import sleep
|
|
|
10
10
|
from typing import Any, Callable, Dict, Final, List, Mapping, Optional
|
|
11
11
|
|
|
12
12
|
import requests
|
|
13
|
+
|
|
13
14
|
from airbyte_cdk.models import FailureType
|
|
14
15
|
from airbyte_cdk.sources.streams.http.error_handlers.response_models import ErrorResolution, ResponseAction
|
|
15
16
|
from airbyte_cdk.utils import AirbyteTracedException
|
|
16
17
|
|
|
18
|
+
|
|
17
19
|
# default logger instance
|
|
18
20
|
LOGGER: Final[logging.Logger] = logging.getLogger("airbyte")
|
|
19
21
|
|
|
@@ -47,7 +49,7 @@ class ShopifyNonRetryableErrors:
|
|
|
47
49
|
response_action=ResponseAction.IGNORE,
|
|
48
50
|
failure_type=FailureType.config_error,
|
|
49
51
|
error_message=f"Stream `{stream}`. Entity might not be available or missing.",
|
|
50
|
-
)
|
|
52
|
+
),
|
|
51
53
|
# extend the mapping with more handable errors, if needed.
|
|
52
54
|
}
|
|
53
55
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
from typing import Any, Iterable, Mapping, MutableMapping, Optional
|
|
7
7
|
|
|
8
8
|
import requests
|
|
9
|
-
from airbyte_cdk.sources.streams.core import package_name_from_class
|
|
10
|
-
from airbyte_cdk.sources.utils.schema_helpers import ResourceSchemaLoader
|
|
11
9
|
from requests.exceptions import RequestException
|
|
12
10
|
from source_shopify.shopify_graphql.bulk.query import (
|
|
13
11
|
Collection,
|
|
@@ -36,6 +34,9 @@ from source_shopify.shopify_graphql.graphql import get_query_products
|
|
|
36
34
|
from source_shopify.utils import ApiTypeEnum
|
|
37
35
|
from source_shopify.utils import ShopifyRateLimiter as limiter
|
|
38
36
|
|
|
37
|
+
from airbyte_cdk.sources.streams.core import package_name_from_class
|
|
38
|
+
from airbyte_cdk.sources.utils.schema_helpers import ResourceSchemaLoader
|
|
39
|
+
|
|
39
40
|
from .base_streams import (
|
|
40
41
|
IncrementalShopifyGraphQlBulkStream,
|
|
41
42
|
IncrementalShopifyNestedStream,
|
|
@@ -249,7 +250,6 @@ class MetafieldCollections(IncrementalShopifyGraphQlBulkStream):
|
|
|
249
250
|
|
|
250
251
|
|
|
251
252
|
class BalanceTransactions(IncrementalShopifyStream):
|
|
252
|
-
|
|
253
253
|
"""
|
|
254
254
|
PaymentsTransactions stream does not support Incremental Refresh based on datetime fields, only `since_id` is supported:
|
|
255
255
|
https://shopify.dev/api/admin-rest/2021-07/resources/transactions
|
|
File without changes
|