Skip to content

Commit 617ac1c

Browse files
authored
additional check for batch_metadata_multi (#2653)
#### Reference Issues/PRs <!--Example: Fixes #1234. See also #3456.--> #### What does this implement or fix? Several additional tests for batch meadata mutli #### Any other comments? #### Checklist <details> <summary> Checklist for code changes... </summary> - [ ] Have you updated the relevant docstrings, documentation and copyright notice? - [ ] Is this contribution tested against [all ArcticDB's features](../docs/mkdocs/docs/technical/contributing.md)? - [ ] Do all exceptions introduced raise appropriate [error messages](https://docs.arcticdb.io/error_messages/)? - [ ] Are API changes highlighted in the PR description? - [ ] Is the PR labelled as enhancement or bug so it appears in autogenerated release notes? </details> <!-- Thanks for contributing a Pull Request to ArcticDB! Please ensure you have taken a look at: - ArcticDB's Code of Conduct: https://github.com/man-group/ArcticDB/blob/master/CODE_OF_CONDUCT.md - ArcticDB's Contribution Licensing: https://github.com/man-group/ArcticDB/blob/master/docs/mkdocs/docs/technical/contributing.md#contribution-licensing --> Co-authored-by: Georgi Rusev <Georgi Rusev>
1 parent f30c921 commit 617ac1c

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

python/tests/integration/arcticdb/version_store/test_basic_version_store.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,20 @@
2727
ArcticDbNotYetImplemented,
2828
InternalException,
2929
UserInputException,
30+
ArcticException,
3031
)
3132
from arcticdb import QueryBuilder
3233
from arcticdb.flattener import Flattener
3334
from arcticdb.version_store import NativeVersionStore
3435
from arcticdb.version_store._store import VersionedItem
3536
from arcticdb_ext.exceptions import _ArcticLegacyCompatibilityException, StorageException
3637
from arcticdb_ext.storage import KeyType, NoDataFoundException
37-
from arcticdb_ext.version_store import NoSuchVersionException, StreamDescriptorMismatch, ManualClockVersionStore
38+
from arcticdb_ext.version_store import (
39+
NoSuchVersionException,
40+
StreamDescriptorMismatch,
41+
ManualClockVersionStore,
42+
DataError,
43+
)
3844
from arcticdb.util.test import (
3945
sample_dataframe,
4046
sample_dataframe_only_strings,
@@ -2211,6 +2217,26 @@ def test_batch_read_meta_multiple_versions(object_version_store):
22112217
assert results_dict["sym3"][0].metadata == {"meta3": 1}
22122218
assert results_dict["sym2"][3].metadata == {"meta2": 4}
22132219

2220+
# We can supply only an array of symbols, including repeating symbols
2221+
results_dict = lib.batch_read_metadata_multi(["sym1", "sym2", "sym1", "sym3", "sym2", "sym1", "sym1"])
2222+
assert results_dict["sym1"][2].metadata == {"meta1": 3}
2223+
assert len(results_dict["sym1"]) == 1
2224+
assert results_dict["sym2"][3].metadata == {"meta2": 4}
2225+
assert results_dict["sym3"][0].metadata == {"meta3": 1}
2226+
2227+
# The lists are of different sizr
2228+
with pytest.raises(ArcticException):
2229+
results_dict = lib.batch_read_metadata_multi(["sym1", "sym2"], [0, 0, -2])
2230+
2231+
# With negative number we can go back from current versions
2232+
assert lib.batch_read_metadata_multi(["sym1", "sym1"], [-1, -2]) == lib.batch_read_metadata_multi(
2233+
["sym1", "sym1"], [2, 1]
2234+
)
2235+
2236+
# Check DataError is thrown when requesting non-existing version
2237+
with pytest.raises(TypeError): # Not a good error though - issue 10070002655
2238+
results_dict = lib.batch_read_metadata_multi(["sym1"], [10])
2239+
22142240

22152241
@pytest.mark.storage
22162242
def test_list_symbols(basic_store):

0 commit comments

Comments
 (0)