Skip to content

Commit 37a36c8

Browse files
author
Malav Shastri
committed
revert HUB_ARN_REGEX and HUB_CONTENT_ARN_REGEX constants from types.py due to the circular dependancy issue
1 parent 5ab02e4 commit 37a36c8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/sagemaker/jumpstart/types.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from copy import deepcopy
1818
from enum import Enum
1919
from typing import Any, Dict, List, Optional, Set, Union
20-
from sagemaker.jumpstart.constants import HUB_ARN_REGEX, HUB_CONTENT_ARN_REGEX
2120
from sagemaker.model_card.model_card import ModelCard, ModelPackageModelCard
2221
from sagemaker.utils import get_instance_type_family, format_tags, Tags, deep_override_dict
2322
from sagemaker.model_metrics import ModelMetrics
@@ -1668,6 +1667,10 @@ def __init__(
16681667
def extract_region_from_arn(arn: str) -> Optional[str]:
16691668
"""Extracts hub_name, content_name, and content_version from a HubContentArn"""
16701669

1670+
HUB_CONTENT_ARN_REGEX = (
1671+
r"arn:(.*?):sagemaker:(.*?):(.*?):hub-content/(.*?)/(.*?)/(.*?)/(.*?)$"
1672+
)
1673+
HUB_ARN_REGEX = r"arn:(.*?):sagemaker:(.*?):(.*?):hub/(.*?)$"
16711674

16721675
match = re.match(HUB_CONTENT_ARN_REGEX, arn)
16731676
hub_region = None

0 commit comments

Comments
 (0)