File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ def to_sdk_part(stored_part: vertexai_types.Part) -> Part:
107107 )
108108 )
109109
110- return Part ( root = TextPart ( text = '' ) )
110+ raise ValueError ( f"Unsupported part: { stored_part } " )
111111
112112
113113def to_stored_artifact (artifact : Artifact ) -> vertexai_types .TaskArtifact :
Original file line number Diff line number Diff line change 11import base64
2- import json
32
43import pytest
54
5+
66pytest .importorskip (
77 'vertexai' , reason = 'Vertex Task Converter tests require vertexai'
88)
@@ -190,11 +190,10 @@ def test_to_sdk_part_file_data() -> None:
190190 assert sdk_part .root .file .uri == 'gs://bucket/image.jpg'
191191
192192
193- def test_to_sdk_part_empty () -> None :
193+ def test_to_sdk_part_unsupported () -> None :
194194 stored_part = vertexai_types .Part ()
195- sdk_part = to_sdk_part (stored_part )
196- assert isinstance (sdk_part .root , TextPart )
197- assert sdk_part .root .text == ''
195+ with pytest .raises (ValueError , match = 'Unsupported part:' ):
196+ to_sdk_part (stored_part )
198197
199198
200199def test_to_stored_artifact () -> None :
You can’t perform that action at this time.
0 commit comments