File tree 2 files changed +32
-0
lines changed
tests/integ/sagemaker/lineage
2 files changed +32
-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,28 @@ 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 (
84
+ filter (lambda x : x .artifact_type == "SDKIntegrationTestType2" , artifact_objs )
85
+ )[0 ].artifact_name
86
+ artifact_names = [art .artifact_name for art in artifact_objs ]
87
+
88
+ artifact_names_listed = [
89
+ artifact_listed .artifact_name
90
+ for artifact_listed in artifact .Artifact .list (
91
+ created_after = now - slack ,
92
+ artifact_type = "SDKIntegrationTestType2" ,
93
+ sagemaker_session = sagemaker_session ,
94
+ )
95
+ if artifact_listed .artifact_name in artifact_names
96
+ ]
97
+
98
+ assert len (artifact_names_listed ) == 1
99
+ assert artifact_names_listed [0 ] == expected_name
100
+
101
+
80
102
def test_downstream_trials (trial_associated_artifact , trial_obj , sagemaker_session ):
81
103
# allow trial components to index, 30 seconds max
82
104
for i in range (3 ):
You can’t perform that action at this time.
0 commit comments