We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dde8d62 commit d0894dfCopy full SHA for d0894df
1 file changed
tests/unit/test_embeddings.py
@@ -57,3 +57,16 @@ def test_vector_embed_text_batch_inputs():
57
for vector in result:
58
assert len(vector) == EXPECTED_DIMENSION
59
assert all(isinstance(v, float) for v in vector)
60
+
61
62
+def test_vector_result_type():
63
+ # Verify that the UDF result type is correctly set to VECTOR(1024)
64
+ # This ensures that databend-udf parses it correctly (if it validates on definition)
65
+ # or at least that the string is passed correctly.
66
+ # The result type is parsed into _result_schema
67
+ assert len(ai_embed_1024._result_schema) == 1
68
+ field = ai_embed_1024._result_schema[0]
69
+ # Check if it is a fixed size list of size 1024
70
+ import pyarrow as pa
71
+ assert pa.types.is_fixed_size_list(field.type)
72
+ assert field.type.list_size == 1024
0 commit comments