From fc1d8f24c5f38bc26c01f94578ed302ed33a1164 Mon Sep 17 00:00:00 2001 From: Alex Owens <73388657+alexowens90@users.noreply.github.com> Date: Thu, 7 Nov 2024 14:28:38 +0000 Subject: [PATCH] Test meaningful error message when reading incompletes from non-existent symbol (#1991) #### Reference Issues/PRs Closes https://github.com/man-group/arcticdb-ursus/issues/8 #### What does this implement or fix? Actual bug was fixed, probably in #1950, this just adds a test of the correct behaviour --- .../arcticdb/version_store/test_incompletes.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/python/tests/unit/arcticdb/version_store/test_incompletes.py b/python/tests/unit/arcticdb/version_store/test_incompletes.py index e9ed2bacf6..5fbbf0ad1a 100644 --- a/python/tests/unit/arcticdb/version_store/test_incompletes.py +++ b/python/tests/unit/arcticdb/version_store/test_incompletes.py @@ -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)) @@ -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)