Skip to content

Commit

Permalink
Test meaningful error message when reading incompletes from non-exist…
Browse files Browse the repository at this point in the history
…ent 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
  • Loading branch information
alexowens90 authored Nov 7, 2024
1 parent c20c189 commit fc1d8f2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions python/tests/unit/arcticdb/version_store/test_incompletes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import pandas as pd
import pytest
from arcticdb.util.test import assert_frame_equal
from arcticdb.exceptions import MissingDataException


@pytest.mark.parametrize("batch", (True, False))
Expand Down Expand Up @@ -46,3 +47,16 @@ def test_read_incompletes_no_indexed_data(lmdb_version_store_v1, batch):
received_vit = lib.read(sym, date_range=(df.index[1], df.index[-2]), incomplete=True)
assert received_vit.symbol == sym
assert_frame_equal(df.iloc[1:-1], received_vit.data)


@pytest.mark.parametrize("batch", (True, False))
def test_read_incompletes_non_existent_symbol(lmdb_version_store_v1, batch):
lib = lmdb_version_store_v1
sym = "test_read_incompletes_non_existent_symbol"
# Incomplete reads require a date range
date_range = (pd.Timestamp(0), pd.Timestamp(1))
with pytest.raises(MissingDataException):
if batch:
lib.batch_read([sym], date_ranges=[date_range], incomplete=True)
else:
lib.read(sym, date_range=date_range, incomplete=True)

0 comments on commit fc1d8f2

Please sign in to comment.