Skip to content

Commit

Permalink
Fix timestamps?
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenv committed Jun 27, 2023
1 parent 4179988 commit 2d76d32
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tiledb/tests/cc/test_cc.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,20 @@ def test_array():
arr.close()
####
arrw = lt.Array(ctx, uri, lt.QueryType.WRITE)
arr.reopen()
arrw.set_open_timestamp_start(1)
arrw.set_open_timestamp_end(1)
arr.reopen()

data = b"abcdef"
arrw.put_metadata("key", lt.DataType.STRING_ASCII, data)
arrw.close()

arr = lt.Array(ctx, uri, lt.QueryType.READ)
arrw.set_open_timestamp_start(1)
arrw.set_open_timestamp_end(1)
arr.reopen()
arr.set_open_timestamp_start(1)
arr.set_open_timestamp_end(1)
arr.reopen()
assert arr.metadata_num() == 1
assert arr.has_metadata("key")
mv = arr.get_metadata("key")
Expand All @@ -144,14 +148,18 @@ def test_array():
arr.close()

arrw = lt.Array(ctx, uri, lt.QueryType.WRITE)
arr.reopen()
arrw.set_open_timestamp_start(2)
arrw.set_open_timestamp_end(2)
arr.reopen()
arrw.delete_metadata("key")
arrw.close()

arr = lt.Array(ctx, uri, lt.QueryType.READ)
arrw.set_open_timestamp_start(3)
arrw.set_open_timestamp_end(3)
arr.reopen()
arr.set_open_timestamp_start(3)
arr.set_open_timestamp_end(3)
arr.reopen()
with pytest.raises(KeyError):
arr.get_metadata("key")
assert not arr.has_metadata("key")[0]
Expand Down

0 comments on commit 2d76d32

Please sign in to comment.