Skip to content

Commit 0deb20e

Browse files
committed
fix: linting
1 parent 4252d86 commit 0deb20e

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

src/sagemaker/jumpstart/curated_hub/accessors/public_model_data.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def __init__(
3333
model_specs: JumpStartModelSpecs,
3434
studio_specs: Dict[str, Dict[str, Any]],
3535
):
36+
"""Creates a PublicModelDataAccessor."""
3637
self._region = region
3738
self._bucket = get_jumpstart_content_bucket(region)
3839
self.model_specs = model_specs

src/sagemaker/jumpstart/curated_hub/types.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ class HubContentSummary:
5050

5151
def summary_from_list_api_response(hub_content_summary: Dict[str, Any]) -> HubContentSummary:
5252
"""Creates a single HubContentSummary.
53-
54-
This is based on the ListHubContent or ListHubContentVersions API response."""
53+
54+
This is based on the ListHubContent or ListHubContentVersions API response.
55+
"""
5556
return HubContentSummary(
5657
hub_content_arn=hub_content_summary.get("HubContentArn"),
5758
hub_content_name=hub_content_summary.get("HubContentName"),
@@ -70,8 +71,9 @@ def summary_list_from_list_api_response(
7071
list_hub_contents_response: Dict[str, Any]
7172
) -> List[HubContentSummary]:
7273
"""Creates a HubContentSummary list.
73-
74-
This is based on the ListHubContent or ListHubContentVersions API response."""
74+
75+
This is based on the ListHubContent or ListHubContentVersions API response.
76+
"""
7577
return list(
7678
map(
7779
summary_from_list_api_response,
@@ -132,6 +134,7 @@ def __init__(
132134
last_updated: Optional[datetime],
133135
dependecy_type: Optional[HubContentDependencyType] = None,
134136
):
137+
"""Creates a FileInfo."""
135138
self.location = S3ObjectLocation(bucket, key)
136139
self.size = size
137140
self.last_updated = last_updated

src/sagemaker/jumpstart/curated_hub/utils.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"""This module contains utilities related to SageMaker JumpStart CuratedHub."""
1414
from __future__ import absolute_import
1515
import re
16-
from typing import Optional, Dict, List, Any
16+
from typing import Optional, Dict, List
1717
from sagemaker.jumpstart.curated_hub.types import S3ObjectLocation
1818
from sagemaker.s3_utils import parse_s3_url
1919
from sagemaker.session import Session
@@ -120,11 +120,7 @@ def generate_hub_arn_for_init_kwargs(
120120
if match:
121121
hub_arn = hub_name
122122
else:
123-
hub_arn = construct_hub_arn_from_name(
124-
hub_name=hub_name,
125-
region=region,
126-
session=session
127-
)
123+
hub_arn = construct_hub_arn_from_name(hub_name=hub_name, region=region, session=session)
128124
return hub_arn
129125

130126

@@ -212,6 +208,7 @@ def _get_tags_for_all_versions(
212208
region: str,
213209
session: Session,
214210
) -> Dict[str, List[CuratedHubUnsupportedFlag]]:
211+
"""Helper function to create mapping between HubContent version and associated tags."""
215212
version_to_tags_map: Dict[str, List[CuratedHubUnsupportedFlag]] = {}
216213
for hub_content_version_summary in hub_content_versions:
217214
jumpstart_model = get_jumpstart_model_and_version(hub_content_version_summary)
@@ -233,6 +230,7 @@ def _get_tags_for_all_versions(
233230
def _convert_to_tag_to_versions_map(
234231
version_to_tags_map: Dict[str, List[CuratedHubUnsupportedFlag]]
235232
) -> Dict[CuratedHubUnsupportedFlag, List[str]]:
233+
"""Helper function to create tag to version map from a version to flag mapping."""
236234
unsupported_hub_content_versions_map: Dict[CuratedHubUnsupportedFlag, List[str]] = {}
237235
for version, tags in version_to_tags_map.items():
238236
for tag in tags:

0 commit comments

Comments
 (0)