fix: pyo3 ut (#4894)

This commit is contained in:
Lei, HUANG
2024-10-28 21:47:57 -07:00
committed by GitHub
parent eab9e3a48d
commit 0ee455a980

View File

@@ -722,6 +722,7 @@ import math
@coprocessor(args=[], returns=["value"], backend="pyo3")
def test_numpy() -> vector[i64]:
from greptime import vector
try:
import numpy as np
import pyarrow as pa
@@ -729,7 +730,6 @@ def test_numpy() -> vector[i64]:
# Python didn't have numpy or pyarrow
print("Warning: no pyarrow or numpy found in current python", e)
return vector([0, 1, 2, 3, 4, 5, 6, 7, 8, 9,])
from greptime import vector
v = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9,])
v = pa.array(v)
v = vector.from_pyarrow(v)