Skip to content

Commit b029be4

Browse files
committed
add unit tests for pandas 1.5
1 parent a2b2097 commit b029be4

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/unit/test_json.py

+13
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
# limitations under the License.
1414

1515

16+
import numpy as np
1617
import pandas as pd
18+
import pandas._testing as tm
1719
import pytest
1820

1921
import db_dtypes
@@ -81,3 +83,14 @@ def test_deterministic_json_serialization():
8183
y = {"b": 1, "a": 0}
8284
data = db_dtypes.JSONArray._from_sequence([y])
8385
assert data[0] == x
86+
87+
88+
def test_to_numpy():
89+
data = db_dtypes.JSONArray._from_sequence(JSON_DATA.values())
90+
expected = np.asarray(data)
91+
92+
result = data.to_numpy()
93+
tm.assert_equal(result, expected)
94+
95+
result = pd.Series(data).to_numpy()
96+
tm.assert_equal(result, expected)

0 commit comments

Comments
 (0)