|
8 | 8 | import numpy as np
|
9 | 9 | import pandas as pd
|
10 | 10 | import pytest
|
11 |
| -from arcticdb.exceptions import SortingException, NormalizationException |
| 11 | +from arcticdb.exceptions import SortingException |
12 | 12 | from arcticdb.util._versions import IS_PANDAS_TWO
|
| 13 | +from arcticdb.util.test import assert_frame_equal |
13 | 14 | from pandas import MultiIndex
|
14 | 15 |
|
15 | 16 |
|
@@ -133,3 +134,28 @@ def test_write_non_timestamp_index(lmdb_version_store, index_type, sorted, valid
|
133 | 134 | assert info["sorted"] == "UNKNOWN"
|
134 | 135 |
|
135 | 136 |
|
| 137 | +def test_write_unicode(lmdb_version_store): |
| 138 | + symbol = "test_write_unicode" |
| 139 | + uc = "\u0420\u043e\u0441\u0441\u0438\u044f" |
| 140 | + |
| 141 | + df1 = pd.DataFrame( |
| 142 | + index=[pd.Timestamp("2018-01-02"), pd.Timestamp("2018-01-03")], |
| 143 | + data={"a": ["123", uc]}, |
| 144 | + ) |
| 145 | + lmdb_version_store.write(symbol, df1) |
| 146 | + vit = lmdb_version_store.read(symbol) |
| 147 | + assert_frame_equal(vit.data, df1) |
| 148 | + |
| 149 | + |
| 150 | +def test_write_parallel_unicode(lmdb_version_store): |
| 151 | + symbol = "test_write_parallel_unicode" |
| 152 | + uc = "\u0420\u043e\u0441\u0441\u0438\u044f" |
| 153 | + |
| 154 | + df1 = pd.DataFrame( |
| 155 | + index=[pd.Timestamp("2018-01-02"), pd.Timestamp("2018-01-03")], |
| 156 | + data={"a": ["123", uc]}, |
| 157 | + ) |
| 158 | + lmdb_version_store.write(symbol, df1, parallel=True) |
| 159 | + lmdb_version_store.compact_incomplete(symbol, append=False, convert_int_to_float=False) |
| 160 | + vit = lmdb_version_store.read(symbol) |
| 161 | + assert_frame_equal(vit.data, df1) |
0 commit comments