File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
tests/integ/sagemaker/lineage Expand file tree Collapse file tree 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):
302302 )
303303 time .sleep (SLEEP_TIME_SECONDS )
304304
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+
305315 yield artifact_objs
306316
307317 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):
7777 assert artifact_names
7878
7979
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+
80102def test_downstream_trials (trial_associated_artifact , trial_obj , sagemaker_session ):
81103 # allow trial components to index, 30 seconds max
82104 for i in range (3 ):
You can’t perform that action at this time.
0 commit comments