Skip to content

Commit

Permalink
Alter type used in test added in #2083
Browse files Browse the repository at this point in the history
  • Loading branch information
kounelisagis committed Nov 29, 2024
1 parent 806d1ae commit ac79327
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tiledb/tests/test_schema_evolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,21 +260,21 @@ def test_schema_evolution_drop_fixed_attribute_and_add_back_as_var_sized(tmp_pat
assert A.schema.attr("b").dtype == np.int32

se = tiledb.ArraySchemaEvolution(ctx)
newattr = tiledb.Attr("a", dtype="S", var=True)
newattr = tiledb.Attr("a", dtype="U", var=True)
se.add_attribute(newattr)
se.array_evolve(uri)

# check schema and data after adding attribute back as a var-sized attribute
with tiledb.open(uri) as A:
assert A.schema.has_attr("a")
assert A.schema.attr("a").dtype == "S"
assert A.schema.attr("a").dtype == "U"
assert A.schema.attr("b").dtype == np.int32
# check that each value == b'\x80' (empty byte)
assert_array_equal(A[:]["a"], np.array([b"\x80" for _ in range(10)]))
assert_array_equal(A[:]["a"], np.array(["" for _ in range(10)]))

# add new data to the array
new_data = np.array(
["tiledb-string-n.{}".format(i) for i in range(1, 11)], dtype="S"
["tiledb-string-n.{}".format(i) for i in range(1, 11)], dtype="U"
)
with tiledb.open(uri, "w") as A:
A[:] = {"a": new_data, "b": original_data}
Expand Down

0 comments on commit ac79327

Please sign in to comment.