MCPcopy
hub / github.com/dask/dask / _nonempty_scalar

Function _nonempty_scalar

dask/dataframe/utils.py:300–311  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

298
299
300def _nonempty_scalar(x):
301 if type(x) in make_scalar._lookup:
302 return make_scalar(x)
303
304 if np.isscalar(x):
305 dtype = x.dtype if hasattr(x, "dtype") else np.dtype(type(x))
306 return make_scalar(dtype)
307
308 if x is pd.NA:
309 return pd.NA
310
311 raise TypeError(f"Can't handle meta of type '{typename(type(x))}'")
312
313
314def check_meta(x, meta, funcname=None, numeric_equal=True):

Callers 3

make_meta_objectFunction · 0.90
meta_nonempty_objectFunction · 0.90

Calls 2

typenameFunction · 0.90
dtypeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…