@@ -56,8 +56,8 @@ class Hub:
56
56
def __init__ (
57
57
self ,
58
58
hub_name : str ,
59
+ sagemaker_session : Session ,
59
60
bucket_name : Optional [str ] = None ,
60
- sagemaker_session : Optional [Session ] = None ,
61
61
) -> None :
62
62
"""Instantiates a SageMaker ``Hub``.
63
63
@@ -94,20 +94,22 @@ def create(
94
94
"""Creates a hub with the given description"""
95
95
curr_timestamp = datetime .now ().timestamp ()
96
96
97
- return self ._sagemaker_session .create_hub (
98
- hub_name = self .hub_name ,
99
- hub_description = description ,
100
- hub_display_name = display_name ,
101
- hub_search_keywords = search_keywords ,
102
- s3_storage_config = {
97
+ request = {
98
+ "hub_name" : self .hub_name ,
99
+ "hub_description" : description ,
100
+ "hub_display_name" : display_name ,
101
+ "hub_search_keywords" : search_keywords ,
102
+ "tags" : tags
103
+ }
104
+
105
+ if self .bucket_name :
106
+ request ["s3_storage_config" ] = {
103
107
"S3OutputPath" : (
104
108
f"s3://{ self .bucket_name } /{ self .hub_name } -{ curr_timestamp } "
105
- if self .bucket_name
106
- else None
107
109
)
108
- },
109
- tags = tags ,
110
- )
110
+ }
111
+
112
+ return self . _sagemaker_session . create_hub ( ** request )
111
113
112
114
def describe (self , hub_name : Optional [str ] = None ) -> DescribeHubResponse :
113
115
"""Returns descriptive information about the Hub"""
0 commit comments