whylogs.core.types.typeddataconverter

TODO: implement this using something other than yaml

Module Contents

Classes

TypedDataConverter

A class to coerce types on data.

Attributes

TYPES

TYPENUM_TO_NAME

INTEGRAL_TYPES

FLOAT_TYPES

whylogs.core.types.typeddataconverter.TYPES
whylogs.core.types.typeddataconverter.TYPENUM_TO_NAME
whylogs.core.types.typeddataconverter.INTEGRAL_TYPES
whylogs.core.types.typeddataconverter.FLOAT_TYPES
class whylogs.core.types.typeddataconverter.TypedDataConverter

A class to coerce types on data.

To see available types:

>>> from whylogs.core.types.typeddataconverter import TYPES
>>> print("\n".join(sorted(TYPES.keys())))
static convert(data)

Convert data to a typed value

If a data is a string, parse data with yaml. Else, return data unchanged

Note: this method is very slow, since it relies on the complex and python-based implementation of yaml.

static _is_array_like(value)
static _are_nulls(value)
static get_type(typed_data)

Extract the data type of a value. See typeddataconvert.TYPES for available types.

Parameters

typed_data – Data processed by TypedDataConverter.convert

Returns

dtype

Return type

TYPES