We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e17595e commit cdcb774Copy full SHA for cdcb774
tests/unit/test_json.py
@@ -13,7 +13,9 @@
13
# limitations under the License.
14
15
16
+import numpy as np
17
import pandas as pd
18
+import pandas._testing as tm
19
import pytest
20
21
import db_dtypes
@@ -81,3 +83,14 @@ def test_deterministic_json_serialization():
81
83
y = {"b": 1, "a": 0}
82
84
data = db_dtypes.JSONArray._from_sequence([y])
85
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
0 commit comments