Improve support for new and user-defined Numpy dtypes (e.g. np.dtypes.StringDType
)
#4039
Labels
enhancement
it's not broken, but we want it to be better
interop
how to play nicely with other packages
(previously: #3950 and #3955 got existing functionality working on Numpy 2.0; now we want to support a new feature)
currently raises
hypothesis.errors.InvalidArgument: No strategy inference for StringDType()
, which is not ideal for something that ships upstream. We could fix that with a special case, but I'd like to support user-defined extension dtypes too if possible, which I expect will take some kind of registry system. (I spoke to @ngoldbaum at Scipy and confirmed that we can't introspect dtypes from Python, though something Arrow-based might eventually be possible)We should also improve the error message if you forget to construct an instance: it's all to easy to do and instead you see
InvalidArgument: Expected dtype but got dtype=<class 'numpy.dtypes.StringDType'> (type=_DTypeMeta)
.The text was updated successfully, but these errors were encountered: