File tree 2 files changed +30
-0
lines changed
tests/integ/sagemaker/lineage
2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -302,6 +302,16 @@ def artifact_objs(sagemaker_session):
302
302
)
303
303
time .sleep (SLEEP_TIME_SECONDS )
304
304
305
+ artifact_objs .append (
306
+ artifact .Artifact .create (
307
+ artifact_name = name (),
308
+ artifact_type = "SDKIntegrationTestType2" ,
309
+ source_uri = name (),
310
+ properties = {"k1" : "v1" },
311
+ sagemaker_session = sagemaker_session ,
312
+ )
313
+ )
314
+
305
315
yield artifact_objs
306
316
307
317
for artifact_obj in artifact_objs :
Original file line number Diff line number Diff line change @@ -77,6 +77,26 @@ def test_list(artifact_objs, sagemaker_session):
77
77
assert artifact_names
78
78
79
79
80
+ def test_list_by_type (artifact_objs , sagemaker_session ):
81
+ slack = datetime .timedelta (minutes = 1 )
82
+ now = datetime .datetime .now (datetime .timezone .utc )
83
+ expected_name = list (filter (lambda x : x .artifact_type == 'SDKIntegrationTestType2' , artifact_objs ))[0 ].artifact_name
84
+ artifact_names = [art .artifact_name for art in artifact_objs ]
85
+
86
+ artifact_names_listed = [
87
+ artifact_listed .artifact_name
88
+ for artifact_listed in artifact .Artifact .list (
89
+ created_after = now - slack ,
90
+ artifact_type = 'SDKIntegrationTestType2' ,
91
+ sagemaker_session = sagemaker_session ,
92
+ )
93
+ if artifact_listed .artifact_name in artifact_names
94
+ ]
95
+
96
+ assert len (artifact_names_listed ) == 1
97
+ assert artifact_names_listed [0 ] == expected_name
98
+
99
+
80
100
def test_downstream_trials (trial_associated_artifact , trial_obj , sagemaker_session ):
81
101
# allow trial components to index, 30 seconds max
82
102
for i in range (3 ):
You can’t perform that action at this time.
0 commit comments