From a6a9b3bd5664a5572b5ed749793c345babf2549c Mon Sep 17 00:00:00 2001 From: Abdul Fatir Date: Fri, 31 Oct 2025 09:21:23 +0000 Subject: [PATCH 1/2] Add DeprecationWarning for cloudfront --- src/chronos/boto_utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/chronos/boto_utils.py b/src/chronos/boto_utils.py index 7d0d16df..70287758 100644 --- a/src/chronos/boto_utils.py +++ b/src/chronos/boto_utils.py @@ -6,6 +6,7 @@ import logging import os import re +import warnings from pathlib import Path import boto3 @@ -110,6 +111,11 @@ def cache_model_from_s3( # Use CloudFront CDN for faster, cached downloads if available if cloudfront_url: + warnings.warn( + f"Loading {s3_uri} from CloudFront is deprecated and will be removed in a future version. " + f"Please specify a HuggingFace model_id instead.", + category=DeprecationWarning, + ) try: download_model_files_from_cloudfront( cloudfront_url=cloudfront_url, From 7bfb3b93203657d6855d638e9cc52eaef4f77afd Mon Sep 17 00:00:00 2001 From: Abdul Fatir Date: Fri, 31 Oct 2025 09:30:57 +0000 Subject: [PATCH 2/2] Address comments --- src/chronos/boto_utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/chronos/boto_utils.py b/src/chronos/boto_utils.py index 70287758..3e20e979 100644 --- a/src/chronos/boto_utils.py +++ b/src/chronos/boto_utils.py @@ -113,8 +113,9 @@ def cache_model_from_s3( if cloudfront_url: warnings.warn( f"Loading {s3_uri} from CloudFront is deprecated and will be removed in a future version. " - f"Please specify a HuggingFace model_id instead.", - category=DeprecationWarning, + f'Please specify a HuggingFace model_id instead. For example: Chronos2Pipeline.from_pretrained("amazon/chronos-2")', + category=FutureWarning, + stacklevel=3, ) try: download_model_files_from_cloudfront(