Skip to content

Commit f086d07

Browse files
committed
handle pandas v3 str types in tests; release
1 parent 21bf2ba commit f086d07

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "affinity"
7-
version = "1.1.0"
7+
version = "1.1.1"
88
description = "Module for creating well-documented datasets, with types and annotations."
99
authors = [
1010
{ name = "Alex Kislukhin" }

test_affinity.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ def test_mixed_dataset_scalar_vector():
173173
class aDatasetVectorScalar(af.Dataset):
174174
"""A well-documented dataset."""
175175

176-
v1 = af.Vector(np.str_, comment="first")
176+
# str dtype works in both pandas v2 and v3, np.str_ only in v2
177+
v1 = af.Vector("str", comment="first")
177178
v2 = af.Scalar(np.int8, comment="second")
178179
v3 = af.VectorF16("third")
179180

@@ -196,12 +197,12 @@ class aDatasetVectorScalar(af.Dataset):
196197
assert data1.metadata.get("table_comment") == "A well-documented dataset."
197198
assert data1.metadata.get("source") == "manual"
198199
expected_df = pd.DataFrame({"v1": list("abcdef"), "v2": 2, "v3": range(6)}).astype(
199-
{"v1": np.str_, "v2": np.int8, "v3": np.float16}
200+
{"v1": "str", "v2": np.int8, "v3": np.float16}
200201
)
201202
pd.testing.assert_frame_equal(data1.df, expected_df)
202203

203204
class aDatasetOnlyVector(af.Dataset):
204-
v1 = af.Vector(np.str_, comment="first")
205+
v1 = af.Vector("str", comment="first")
205206
v2 = af.Vector(np.int8, comment="second")
206207
v3 = af.VectorF16("third")
207208

0 commit comments

Comments
 (0)