Skip to content

Commit a4090e3

Browse files
committed
fixes as per co-pilot
1 parent b748222 commit a4090e3

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

tap_shopify/exceptions.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,3 @@ class BulkOperationInProgressError(Exception):
1010
def __init__(self, message, bulk_op_id=None):
1111
super().__init__(message)
1212
self.bulk_op_id = bulk_op_id
13-
14-
def __str__(self):
15-
# Make sure ShopifyError(exc) shows the full message
16-
base_msg = super().__str__()
17-
return base_msg

tap_shopify/streams/orders.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,7 +1267,6 @@ def get_objects(self):
12671267
max_tries=7,
12681268
factor=10,
12691269
jitter=None,
1270-
giveup=lambda e: not isinstance(e, BulkOperationInProgressError),
12711270
on_backoff=lambda details: LOGGER.warning(
12721271
"Bulk operation already in progress (ID: %s). "
12731272
"Retry attempt %d after %.2f seconds. Total elapsed: %.2f seconds.",
@@ -1277,8 +1276,9 @@ def get_objects(self):
12771276
details['elapsed']
12781277
)
12791278
)
1280-
def submit_and_poll_bulk_query(self, query_template, last_updated_at, \
1281-
query_end, current_bookmark):
1279+
def submit_and_poll_bulk_query(
1280+
self, query_template, last_updated_at, query_end, current_bookmark
1281+
):
12821282
"""Submit bulk query and poll for completion with automatic retry on conflicts"""
12831283
with metrics.http_request_timer(self.name):
12841284
query_filter = self.build_query_filter(
@@ -1299,8 +1299,10 @@ def submit_and_poll_bulk_query(self, query_template, last_updated_at, \
12991299
if user_errors:
13001300
for error in user_errors:
13011301
message = error.get("message", "")
1302-
if "bulk query operation for this app and shop is already in progress" \
1303-
in message:
1302+
if (
1303+
"bulk query operation for this app and shop is already in progress"
1304+
in message
1305+
):
13041306
# Extract BulkOperation ID using regex
13051307
match = re.search(r"gid://shopify/BulkOperation/\d+", message)
13061308
bulk_op_id = match.group(0) if match else None

0 commit comments

Comments
 (0)