Skip to content

Commit fc1d8f2

Browse files
authored
Test meaningful error message when reading incompletes from non-existent symbol (#1991)
#### Reference Issues/PRs Closes man-group/arcticdb-ursus#8 #### What does this implement or fix? Actual bug was fixed, probably in #1950, this just adds a test of the correct behaviour
1 parent c20c189 commit fc1d8f2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

python/tests/unit/arcticdb/version_store/test_incompletes.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import pandas as pd
1010
import pytest
1111
from arcticdb.util.test import assert_frame_equal
12+
from arcticdb.exceptions import MissingDataException
1213

1314

1415
@pytest.mark.parametrize("batch", (True, False))
@@ -46,3 +47,16 @@ def test_read_incompletes_no_indexed_data(lmdb_version_store_v1, batch):
4647
received_vit = lib.read(sym, date_range=(df.index[1], df.index[-2]), incomplete=True)
4748
assert received_vit.symbol == sym
4849
assert_frame_equal(df.iloc[1:-1], received_vit.data)
50+
51+
52+
@pytest.mark.parametrize("batch", (True, False))
53+
def test_read_incompletes_non_existent_symbol(lmdb_version_store_v1, batch):
54+
lib = lmdb_version_store_v1
55+
sym = "test_read_incompletes_non_existent_symbol"
56+
# Incomplete reads require a date range
57+
date_range = (pd.Timestamp(0), pd.Timestamp(1))
58+
with pytest.raises(MissingDataException):
59+
if batch:
60+
lib.batch_read([sym], date_ranges=[date_range], incomplete=True)
61+
else:
62+
lib.read(sym, date_range=date_range, incomplete=True)

0 commit comments

Comments
 (0)