Fix schema_like for string types
@@ -131,6 +131,10 @@ def schema_like(*args, shape=None, dtype=None, ctx=default_ctx(), **kw):
def is_ndarray_like(obj):
return hasattr(arr, 'shape') and hasattr(arr, 'dtype') and hasattr(arr, 'ndim')
+ if np.issubdtype(np.bytes_, dtype):
+ dtype = np.dtype('S')
+ elif np.issubdtype(np.unicode_, dtype):
+ dtype = np.dtype('U')
if len(args) == 1:
arr = args[0]
if is_ndarray_like(arr):
