From 44e5f1b583ea5c55c714c809174d76262b59bf7d Mon Sep 17 00:00:00 2001 From: Vi6hal Date: Fri, 24 Jan 2025 13:01:36 +0530 Subject: [PATCH 01/12] disable deprecated streams --- tap_shopify/__init__.py | 6 ++++++ tap_shopify/streams/metafields.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tap_shopify/__init__.py b/tap_shopify/__init__.py index c6323c90..0272a2f6 100644 --- a/tap_shopify/__init__.py +++ b/tap_shopify/__init__.py @@ -18,6 +18,8 @@ import tap_shopify.streams # Load stream objects into Context REQUIRED_CONFIG_KEYS = ["shop", "api_key"] +DISABLED_STREAMS = ["products", "inventory_items"] + LOGGER = singer.get_logger() SDC_KEYS = {'id': 'integer', 'name': 'string', 'myshopify_domain': 'string'} @@ -146,6 +148,8 @@ def sync(): # Emit all schemas first so we have them for child streams for stream in Context.catalog["streams"]: if Context.is_selected(stream["tap_stream_id"]): + if stream["tap_stream_id"] in DISABLED_STREAMS: + continue singer.write_schema(stream["tap_stream_id"], stream["schema"], stream["key_properties"], @@ -155,6 +159,8 @@ def sync(): # Loop over streams in catalog for catalog_entry in Context.catalog['streams']: stream_id = catalog_entry['tap_stream_id'] + if stream_id in DISABLED_STREAMS: + continue stream = Context.stream_objects[stream_id]() if not Context.is_selected(stream_id): diff --git a/tap_shopify/streams/metafields.py b/tap_shopify/streams/metafields.py index 2c62d1d0..9eb102da 100644 --- a/tap_shopify/streams/metafields.py +++ b/tap_shopify/streams/metafields.py @@ -11,7 +11,7 @@ LOGGER = singer.get_logger() def get_selected_parents(): - for parent_stream in ['orders', 'customers', 'products', 'custom_collections']: + for parent_stream in ['orders', 'customers', 'custom_collections']: if Context.is_selected(parent_stream): yield Context.stream_objects[parent_stream]() From 7749d7a538768d7eac2639051257942a196ecab5 Mon Sep 17 00:00:00 2001 From: Vi6hal Date: Fri, 24 Jan 2025 13:09:42 +0530 Subject: [PATCH 02/12] added log statement --- tap_shopify/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tap_shopify/__init__.py b/tap_shopify/__init__.py index 0272a2f6..5a2c4aa5 100644 --- a/tap_shopify/__init__.py +++ b/tap_shopify/__init__.py @@ -160,7 +160,8 @@ def sync(): for catalog_entry in Context.catalog['streams']: stream_id = catalog_entry['tap_stream_id'] if stream_id in DISABLED_STREAMS: - continue + LOGGER.critical('Deprecated stream: %s, please upgrade to latest version', stream_id) + continue stream = Context.stream_objects[stream_id]() if not Context.is_selected(stream_id): From 61dc6c5450ae7dc010bb94c74bd5b5f76f929ed1 Mon Sep 17 00:00:00 2001 From: Sourabh Gandhi Date: Mon, 27 Jan 2025 10:06:41 +0000 Subject: [PATCH 03/12] raise the exception message according to the dates --- tap_shopify/__init__.py | 31 ++++++++++++++++++++++++------- tap_shopify/streams/metafields.py | 2 +- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/tap_shopify/__init__.py b/tap_shopify/__init__.py index 5a2c4aa5..dc1d047f 100644 --- a/tap_shopify/__init__.py +++ b/tap_shopify/__init__.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 import os -import datetime +from datetime import datetime, timezone import json import time import math @@ -18,10 +18,29 @@ import tap_shopify.streams # Load stream objects into Context REQUIRED_CONFIG_KEYS = ["shop", "api_key"] -DISABLED_STREAMS = ["products", "inventory_items"] LOGGER = singer.get_logger() SDC_KEYS = {'id': 'integer', 'name': 'string', 'myshopify_domain': 'string'} +DEPRECATED_STREAMS = ["products", "inventory_items", "metafields"] +SELECTED_DEPRECATED_STREAMS = [] + +def raise_warning(): + cutoff_date = datetime(2025, 1, 31, tzinfo=timezone.utc).date() + today_utc = datetime.now(timezone.utc).date() + + if SELECTED_DEPRECATED_STREAMS: + if today_utc > cutoff_date: + raise Exception( + f"The {SELECTED_DEPRECATED_STREAMS} streams are no longer supported after 31st January 2025. " + "Please upgrade to the latest version of tap-shopify, which supports GraphQL endpoints for these streams." + ) + else: + days_left = (cutoff_date - today_utc).days + raise Exception( + f"WARNING: The {SELECTED_DEPRECATED_STREAMS} streams are deprecated and will no longer be supported " + f"after 31st January 2025, ({days_left} days left). Please upgrade to the latest version of tap-shopify, " + "which supports GraphQL endpoints for these streams." + ) @shopify_error_handling def initialize_shopify_client(): @@ -148,20 +167,17 @@ def sync(): # Emit all schemas first so we have them for child streams for stream in Context.catalog["streams"]: if Context.is_selected(stream["tap_stream_id"]): - if stream["tap_stream_id"] in DISABLED_STREAMS: - continue singer.write_schema(stream["tap_stream_id"], stream["schema"], stream["key_properties"], bookmark_properties=stream["replication_key"]) Context.counts[stream["tap_stream_id"]] = 0 + if stream["tap_stream_id"] in DEPRECATED_STREAMS: + SELECTED_DEPRECATED_STREAMS.append(stream["tap_stream_id"]) # Loop over streams in catalog for catalog_entry in Context.catalog['streams']: stream_id = catalog_entry['tap_stream_id'] - if stream_id in DISABLED_STREAMS: - LOGGER.critical('Deprecated stream: %s, please upgrade to latest version', stream_id) - continue stream = Context.stream_objects[stream_id]() if not Context.is_selected(stream_id): @@ -218,6 +234,7 @@ def main(): Context.catalog = discover() sync() + raise_warning() except pyactiveresource.connection.ResourceNotFound as exc: raise ShopifyError(exc, 'Ensure shop is entered correctly') from exc except pyactiveresource.connection.UnauthorizedAccess as exc: diff --git a/tap_shopify/streams/metafields.py b/tap_shopify/streams/metafields.py index 9eb102da..2c62d1d0 100644 --- a/tap_shopify/streams/metafields.py +++ b/tap_shopify/streams/metafields.py @@ -11,7 +11,7 @@ LOGGER = singer.get_logger() def get_selected_parents(): - for parent_stream in ['orders', 'customers', 'custom_collections']: + for parent_stream in ['orders', 'customers', 'products', 'custom_collections']: if Context.is_selected(parent_stream): yield Context.stream_objects[parent_stream]() From 7d8d57d09b8801067985859c1fb028e1d348c045 Mon Sep 17 00:00:00 2001 From: Sourabh Gandhi Date: Mon, 27 Jan 2025 10:19:19 +0000 Subject: [PATCH 04/12] make custom exception class for the deprecation streams --- tap_shopify/__init__.py | 8 +++++--- tap_shopify/exceptions.py | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tap_shopify/__init__.py b/tap_shopify/__init__.py index dc1d047f..8659b3a5 100644 --- a/tap_shopify/__init__.py +++ b/tap_shopify/__init__.py @@ -13,7 +13,7 @@ from singer import metadata from singer import Transformer from tap_shopify.context import Context -from tap_shopify.exceptions import ShopifyError +from tap_shopify.exceptions import ShopifyError, SHopifyDeprecationError from tap_shopify.streams.base import shopify_error_handling, get_request_timeout import tap_shopify.streams # Load stream objects into Context @@ -30,13 +30,13 @@ def raise_warning(): if SELECTED_DEPRECATED_STREAMS: if today_utc > cutoff_date: - raise Exception( + raise SHopifyDeprecationError( f"The {SELECTED_DEPRECATED_STREAMS} streams are no longer supported after 31st January 2025. " "Please upgrade to the latest version of tap-shopify, which supports GraphQL endpoints for these streams." ) else: days_left = (cutoff_date - today_utc).days - raise Exception( + raise SHopifyDeprecationError( f"WARNING: The {SELECTED_DEPRECATED_STREAMS} streams are deprecated and will no longer be supported " f"after 31st January 2025, ({days_left} days left). Please upgrade to the latest version of tap-shopify, " "which supports GraphQL endpoints for these streams." @@ -248,6 +248,8 @@ def main(): msg = body.get('errors') finally: raise ShopifyError(exc, msg) from exc + except SHopifyDeprecationError as exc: + raise SHopifyDeprecationError(exc) from None except Exception as exc: raise ShopifyError(exc) from exc diff --git a/tap_shopify/exceptions.py b/tap_shopify/exceptions.py index 94fa62dd..093328d9 100644 --- a/tap_shopify/exceptions.py +++ b/tap_shopify/exceptions.py @@ -1,3 +1,6 @@ class ShopifyError(Exception): def __init__(self, error, msg=''): super().__init__('{}\n{}'.format(error.__class__.__name__, msg)) + +class SHopifyDeprecationError(Exception): + pass From a236d49b1955e0994dbdc5adeedd338d3ce210f4 Mon Sep 17 00:00:00 2001 From: Sourabh Gandhi Date: Mon, 27 Jan 2025 11:36:06 +0000 Subject: [PATCH 05/12] Skip the deprecated stream with the logger message after 31st Jan 2025 --- tap_shopify/__init__.py | 28 +++++++++++++++++----------- tap_shopify/exceptions.py | 2 +- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/tap_shopify/__init__.py b/tap_shopify/__init__.py index 8659b3a5..b31dabb2 100644 --- a/tap_shopify/__init__.py +++ b/tap_shopify/__init__.py @@ -13,7 +13,7 @@ from singer import metadata from singer import Transformer from tap_shopify.context import Context -from tap_shopify.exceptions import ShopifyError, SHopifyDeprecationError +from tap_shopify.exceptions import ShopifyError, ShopifyDeprecationError from tap_shopify.streams.base import shopify_error_handling, get_request_timeout import tap_shopify.streams # Load stream objects into Context @@ -23,20 +23,20 @@ SDC_KEYS = {'id': 'integer', 'name': 'string', 'myshopify_domain': 'string'} DEPRECATED_STREAMS = ["products", "inventory_items", "metafields"] SELECTED_DEPRECATED_STREAMS = [] +CUTOFF_DATE = datetime(2025, 1, 31, tzinfo=timezone.utc).date() +TODAY_UTC = datetime.now(timezone.utc).date() def raise_warning(): - cutoff_date = datetime(2025, 1, 31, tzinfo=timezone.utc).date() - today_utc = datetime.now(timezone.utc).date() if SELECTED_DEPRECATED_STREAMS: - if today_utc > cutoff_date: - raise SHopifyDeprecationError( + if TODAY_UTC > CUTOFF_DATE: + raise ShopifyDeprecationError( f"The {SELECTED_DEPRECATED_STREAMS} streams are no longer supported after 31st January 2025. " "Please upgrade to the latest version of tap-shopify, which supports GraphQL endpoints for these streams." ) else: - days_left = (cutoff_date - today_utc).days - raise SHopifyDeprecationError( + days_left = (CUTOFF_DATE - TODAY_UTC).days + raise ShopifyDeprecationError( f"WARNING: The {SELECTED_DEPRECATED_STREAMS} streams are deprecated and will no longer be supported " f"after 31st January 2025, ({days_left} days left). Please upgrade to the latest version of tap-shopify, " "which supports GraphQL endpoints for these streams." @@ -172,8 +172,6 @@ def sync(): stream["key_properties"], bookmark_properties=stream["replication_key"]) Context.counts[stream["tap_stream_id"]] = 0 - if stream["tap_stream_id"] in DEPRECATED_STREAMS: - SELECTED_DEPRECATED_STREAMS.append(stream["tap_stream_id"]) # Loop over streams in catalog for catalog_entry in Context.catalog['streams']: @@ -184,6 +182,14 @@ def sync(): LOGGER.info('Skipping stream: %s', stream_id) continue + if stream_id in DEPRECATED_STREAMS: + SELECTED_DEPRECATED_STREAMS.append(stream_id) + if TODAY_UTC > CUTOFF_DATE: + LOGGER.critical( + f"The {stream_id} stream is no longer supported. " + "Please upgrade to the latest version of tap-shopify, which supports GraphQL endpoints for this stream." + ) + continue LOGGER.info('Syncing stream: %s', stream_id) if not Context.state.get('bookmarks'): @@ -248,8 +254,8 @@ def main(): msg = body.get('errors') finally: raise ShopifyError(exc, msg) from exc - except SHopifyDeprecationError as exc: - raise SHopifyDeprecationError(exc) from None + except ShopifyDeprecationError as exc: + raise ShopifyDeprecationError(exc) from None except Exception as exc: raise ShopifyError(exc) from exc diff --git a/tap_shopify/exceptions.py b/tap_shopify/exceptions.py index 093328d9..1284f2a5 100644 --- a/tap_shopify/exceptions.py +++ b/tap_shopify/exceptions.py @@ -2,5 +2,5 @@ class ShopifyError(Exception): def __init__(self, error, msg=''): super().__init__('{}\n{}'.format(error.__class__.__name__, msg)) -class SHopifyDeprecationError(Exception): +class ShopifyDeprecationError(Exception): pass From da97101a592e4e3d3b13f478f05cfd2b99f0ebe1 Mon Sep 17 00:00:00 2001 From: Sourabh Gandhi Date: Mon, 27 Jan 2025 12:19:45 +0000 Subject: [PATCH 06/12] add deprecation message for product metafields as well --- tap_shopify/__init__.py | 13 ++++++++++--- tap_shopify/streams/metafields.py | 9 ++++++++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/tap_shopify/__init__.py b/tap_shopify/__init__.py index b31dabb2..1721c491 100644 --- a/tap_shopify/__init__.py +++ b/tap_shopify/__init__.py @@ -21,23 +21,27 @@ LOGGER = singer.get_logger() SDC_KEYS = {'id': 'integer', 'name': 'string', 'myshopify_domain': 'string'} -DEPRECATED_STREAMS = ["products", "inventory_items", "metafields"] +DEPRECATED_STREAMS = ["products", "inventory_items"] +IS_METAFIELDS_SELECTED = False SELECTED_DEPRECATED_STREAMS = [] CUTOFF_DATE = datetime(2025, 1, 31, tzinfo=timezone.utc).date() TODAY_UTC = datetime.now(timezone.utc).date() def raise_warning(): + if "products" in SELECTED_DEPRECATED_STREAMS and IS_METAFIELDS_SELECTED: + SELECTED_DEPRECATED_STREAMS.append("product metafields") + if SELECTED_DEPRECATED_STREAMS: if TODAY_UTC > CUTOFF_DATE: raise ShopifyDeprecationError( - f"The {SELECTED_DEPRECATED_STREAMS} streams are no longer supported after 31st January 2025. " + f"The {SELECTED_DEPRECATED_STREAMS} are no longer supported after 31st January 2025. " "Please upgrade to the latest version of tap-shopify, which supports GraphQL endpoints for these streams." ) else: days_left = (CUTOFF_DATE - TODAY_UTC).days raise ShopifyDeprecationError( - f"WARNING: The {SELECTED_DEPRECATED_STREAMS} streams are deprecated and will no longer be supported " + f"WARNING: The {SELECTED_DEPRECATED_STREAMS} are deprecated and will no longer be supported " f"after 31st January 2025, ({days_left} days left). Please upgrade to the latest version of tap-shopify, " "which supports GraphQL endpoints for these streams." ) @@ -190,6 +194,9 @@ def sync(): "Please upgrade to the latest version of tap-shopify, which supports GraphQL endpoints for this stream." ) continue + if stream_id == 'metafields': + global IS_METAFIELDS_SELECTED + IS_METAFIELDS_SELECTED = True LOGGER.info('Syncing stream: %s', stream_id) if not Context.state.get('bookmarks'): diff --git a/tap_shopify/streams/metafields.py b/tap_shopify/streams/metafields.py index 2c62d1d0..a39450f3 100644 --- a/tap_shopify/streams/metafields.py +++ b/tap_shopify/streams/metafields.py @@ -1,6 +1,7 @@ import json import shopify import singer +from datetime import datetime, timezone from tap_shopify.context import Context from tap_shopify.streams.base import (Stream, @@ -9,9 +10,15 @@ OutOfOrderIdsError) LOGGER = singer.get_logger() +CUTOFF_DATE = datetime(2025, 1, 31, tzinfo=timezone.utc).date() +TODAY_UTC = datetime.now(timezone.utc).date() +PARENT_STREAMS = ['orders', 'customers', 'products', 'custom_collections'] def get_selected_parents(): - for parent_stream in ['orders', 'customers', 'products', 'custom_collections']: + # Shopify has sunset the products REST API endpoint on 31st January 2025 + if TODAY_UTC > CUTOFF_DATE: + PARENT_STREAMS.remove('products') + for parent_stream in PARENT_STREAMS: if Context.is_selected(parent_stream): yield Context.stream_objects[parent_stream]() From ba9b5da89a5d47e4df98f53b5012f8c179214461 Mon Sep 17 00:00:00 2001 From: Sourabh Gandhi Date: Mon, 27 Jan 2025 13:06:08 +0000 Subject: [PATCH 07/12] use singer utils for datetime --- tap_shopify/__init__.py | 4 ++-- tap_shopify/streams/metafields.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tap_shopify/__init__.py b/tap_shopify/__init__.py index 1721c491..81a2a960 100644 --- a/tap_shopify/__init__.py +++ b/tap_shopify/__init__.py @@ -24,8 +24,8 @@ DEPRECATED_STREAMS = ["products", "inventory_items"] IS_METAFIELDS_SELECTED = False SELECTED_DEPRECATED_STREAMS = [] -CUTOFF_DATE = datetime(2025, 1, 31, tzinfo=timezone.utc).date() -TODAY_UTC = datetime.now(timezone.utc).date() +CUTOFF_DATE = datetime(2025, 1, 31, tzinfo=timezone.utc) +TODAY_UTC = utils.now() def raise_warning(): diff --git a/tap_shopify/streams/metafields.py b/tap_shopify/streams/metafields.py index a39450f3..5dcb70a6 100644 --- a/tap_shopify/streams/metafields.py +++ b/tap_shopify/streams/metafields.py @@ -1,6 +1,7 @@ import json import shopify import singer +from singer import utils from datetime import datetime, timezone from tap_shopify.context import Context @@ -10,8 +11,8 @@ OutOfOrderIdsError) LOGGER = singer.get_logger() -CUTOFF_DATE = datetime(2025, 1, 31, tzinfo=timezone.utc).date() -TODAY_UTC = datetime.now(timezone.utc).date() +CUTOFF_DATE = datetime(2025, 1, 31, tzinfo=timezone.utc) +TODAY_UTC = utils.now() PARENT_STREAMS = ['orders', 'customers', 'products', 'custom_collections'] def get_selected_parents(): From 37e18a523bab3e245a23afbc8b86a089d8a7e662 Mon Sep 17 00:00:00 2001 From: Sourabh Gandhi Date: Mon, 27 Jan 2025 16:54:49 +0000 Subject: [PATCH 08/12] update setup and changelog --- CHANGELOG.md | 4 ++++ setup.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f980a9fd..f9498567 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.11.0 + * Deprecate the streams for the older version. [#196](https://github.com/singer-io/tap-shopify/pull/196) + * Deprecated streams - products, inventory_items, metafields (product) + ## 1.10.0 * Updates the Shopify SDK to 12.3.0 * Updates API version used to 2024-01 diff --git a/setup.py b/setup.py index 30f2aec2..b97ffd3a 100755 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name="tap-shopify", - version="1.10.0", + version="1.11.0", description="Singer.io tap for extracting Shopify data", author="Stitch", url="http://github.com/singer-io/tap-shopify", From aeddc305a9fa3c4e5957ed4393ecbd433a529586 Mon Sep 17 00:00:00 2001 From: Sourabh Gandhi Date: Mon, 27 Jan 2025 20:35:33 +0000 Subject: [PATCH 09/12] update exit message --- tap_shopify/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tap_shopify/__init__.py b/tap_shopify/__init__.py index 81a2a960..c2010c75 100644 --- a/tap_shopify/__init__.py +++ b/tap_shopify/__init__.py @@ -30,18 +30,18 @@ def raise_warning(): if "products" in SELECTED_DEPRECATED_STREAMS and IS_METAFIELDS_SELECTED: - SELECTED_DEPRECATED_STREAMS.append("product metafields") + SELECTED_DEPRECATED_STREAMS.append("metafields (product related)") if SELECTED_DEPRECATED_STREAMS: if TODAY_UTC > CUTOFF_DATE: raise ShopifyDeprecationError( - f"The {SELECTED_DEPRECATED_STREAMS} are no longer supported after 31st January 2025. " + f"The {SELECTED_DEPRECATED_STREAMS} stream(s) are no longer supported after 31st January 2025. " "Please upgrade to the latest version of tap-shopify, which supports GraphQL endpoints for these streams." ) else: days_left = (CUTOFF_DATE - TODAY_UTC).days raise ShopifyDeprecationError( - f"WARNING: The {SELECTED_DEPRECATED_STREAMS} are deprecated and will no longer be supported " + f"WARNING: The {SELECTED_DEPRECATED_STREAMS} stream(s) are deprecated and will no longer be supported " f"after 31st January 2025, ({days_left} days left). Please upgrade to the latest version of tap-shopify, " "which supports GraphQL endpoints for these streams." ) From 7d9738e6335babe593fc0f421cfa75f59e71f7ed Mon Sep 17 00:00:00 2001 From: Sourabh Gandhi Date: Wed, 29 Jan 2025 14:06:08 +0000 Subject: [PATCH 10/12] Update the date to 31st March --- tap_shopify/__init__.py | 6 +++--- tap_shopify/streams/metafields.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tap_shopify/__init__.py b/tap_shopify/__init__.py index c2010c75..72622bc7 100644 --- a/tap_shopify/__init__.py +++ b/tap_shopify/__init__.py @@ -24,7 +24,7 @@ DEPRECATED_STREAMS = ["products", "inventory_items"] IS_METAFIELDS_SELECTED = False SELECTED_DEPRECATED_STREAMS = [] -CUTOFF_DATE = datetime(2025, 1, 31, tzinfo=timezone.utc) +CUTOFF_DATE = datetime(2025, 3, 31, tzinfo=timezone.utc) TODAY_UTC = utils.now() def raise_warning(): @@ -35,14 +35,14 @@ def raise_warning(): if SELECTED_DEPRECATED_STREAMS: if TODAY_UTC > CUTOFF_DATE: raise ShopifyDeprecationError( - f"The {SELECTED_DEPRECATED_STREAMS} stream(s) are no longer supported after 31st January 2025. " + f"The {SELECTED_DEPRECATED_STREAMS} stream(s) are no longer supported after 31st March 2025. " "Please upgrade to the latest version of tap-shopify, which supports GraphQL endpoints for these streams." ) else: days_left = (CUTOFF_DATE - TODAY_UTC).days raise ShopifyDeprecationError( f"WARNING: The {SELECTED_DEPRECATED_STREAMS} stream(s) are deprecated and will no longer be supported " - f"after 31st January 2025, ({days_left} days left). Please upgrade to the latest version of tap-shopify, " + f"after 31st March 2025, ({days_left} days left). Please upgrade to the latest version of tap-shopify, " "which supports GraphQL endpoints for these streams." ) diff --git a/tap_shopify/streams/metafields.py b/tap_shopify/streams/metafields.py index 5dcb70a6..6c62875b 100644 --- a/tap_shopify/streams/metafields.py +++ b/tap_shopify/streams/metafields.py @@ -11,7 +11,7 @@ OutOfOrderIdsError) LOGGER = singer.get_logger() -CUTOFF_DATE = datetime(2025, 1, 31, tzinfo=timezone.utc) +CUTOFF_DATE = datetime(2025, 3, 31, tzinfo=timezone.utc) TODAY_UTC = utils.now() PARENT_STREAMS = ['orders', 'customers', 'products', 'custom_collections'] From 9bfa738abe06d7d5ee25b859229b370658c4bfee Mon Sep 17 00:00:00 2001 From: Sourabh Gandhi Date: Thu, 30 Jan 2025 10:52:03 +0000 Subject: [PATCH 11/12] Remove the days left warning --- tap_shopify/__init__.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tap_shopify/__init__.py b/tap_shopify/__init__.py index 72622bc7..c25b4a69 100644 --- a/tap_shopify/__init__.py +++ b/tap_shopify/__init__.py @@ -38,13 +38,6 @@ def raise_warning(): f"The {SELECTED_DEPRECATED_STREAMS} stream(s) are no longer supported after 31st March 2025. " "Please upgrade to the latest version of tap-shopify, which supports GraphQL endpoints for these streams." ) - else: - days_left = (CUTOFF_DATE - TODAY_UTC).days - raise ShopifyDeprecationError( - f"WARNING: The {SELECTED_DEPRECATED_STREAMS} stream(s) are deprecated and will no longer be supported " - f"after 31st March 2025, ({days_left} days left). Please upgrade to the latest version of tap-shopify, " - "which supports GraphQL endpoints for these streams." - ) @shopify_error_handling def initialize_shopify_client(): From e23149ddc4e52e30f2661a9d9d82bf14032b452a Mon Sep 17 00:00:00 2001 From: Sourabh Gandhi Date: Thu, 30 Jan 2025 11:04:21 +0000 Subject: [PATCH 12/12] update condition --- tap_shopify/__init__.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tap_shopify/__init__.py b/tap_shopify/__init__.py index c25b4a69..06c6025f 100644 --- a/tap_shopify/__init__.py +++ b/tap_shopify/__init__.py @@ -32,12 +32,11 @@ def raise_warning(): if "products" in SELECTED_DEPRECATED_STREAMS and IS_METAFIELDS_SELECTED: SELECTED_DEPRECATED_STREAMS.append("metafields (product related)") - if SELECTED_DEPRECATED_STREAMS: - if TODAY_UTC > CUTOFF_DATE: - raise ShopifyDeprecationError( - f"The {SELECTED_DEPRECATED_STREAMS} stream(s) are no longer supported after 31st March 2025. " - "Please upgrade to the latest version of tap-shopify, which supports GraphQL endpoints for these streams." - ) + if SELECTED_DEPRECATED_STREAMS and TODAY_UTC > CUTOFF_DATE: + raise ShopifyDeprecationError( + f"The {SELECTED_DEPRECATED_STREAMS} stream(s) are no longer supported after 31st March 2025. " + "Please upgrade to the latest version of tap-shopify, which supports GraphQL endpoints for these streams." + ) @shopify_error_handling def initialize_shopify_client():