Skip to content

Commit

Permalink
Use lib tool append_incomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
alexowens90 committed Nov 6, 2024
1 parent 75ff7dd commit ded29e3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/tests/unit/arcticdb/version_store/test_incompletes.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
@pytest.mark.parametrize("batch", (True, False))
def test_read_incompletes_with_indexed_data(lmdb_version_store_v1, batch):
lib = lmdb_version_store_v1
lib_tool = lib.library_tool()
sym = "test_read_incompletes_with_indexed_data"
num_rows = 10
df = pd.DataFrame({"col": np.arange(num_rows)}, pd.date_range("2024-01-01", periods=num_rows))
lib.write(sym, df.iloc[:num_rows // 2])
for idx in range(num_rows // 2, num_rows):
lib.write(sym, df.iloc[idx: idx+1], incomplete=True)
lib_tool.append_incomplete(sym, df.iloc[idx: idx+1])
assert lib.has_symbol(sym)
if batch:
received_vit = lib.batch_read([sym], date_ranges=[(df.index[1], df.index[-2])], incomplete=True)[sym]
Expand All @@ -32,11 +33,12 @@ def test_read_incompletes_with_indexed_data(lmdb_version_store_v1, batch):
@pytest.mark.parametrize("batch", (True, False))
def test_read_incompletes_no_indexed_data(lmdb_version_store_v1, batch):
lib = lmdb_version_store_v1
lib_tool = lib.library_tool()
sym = "test_read_incompletes_no_indexed_data"
num_rows = 10
df = pd.DataFrame({"col": np.arange(num_rows)}, pd.date_range("2024-01-01", periods=num_rows))
for idx in range(num_rows):
lib.write(sym, df.iloc[idx: idx+1], incomplete=True)
lib_tool.append_incomplete(sym, df.iloc[idx: idx+1])
assert not lib.has_symbol(sym)
if batch:
received_vit = lib.batch_read([sym], date_ranges=[(df.index[1], df.index[-2])], incomplete=True)[sym]
Expand Down

0 comments on commit ded29e3

Please sign in to comment.