whylogs.core.relations#

Module Contents#

Classes#

ValueGetter

Helper class that provides a standard way to create an ABC using

LiteralGetter

Helper class that provides a standard way to create an ABC using

Relation

Generic enumeration.

Predicate

Functions#

unescape_quote(→ str)

unescape_colon(→ str)

escape(→ str)

Not(→ Predicate)

Require(→ Predicate)

class whylogs.core.relations.ValueGetter#

Bases: abc.ABC

Helper class that provides a standard way to create an ABC using inheritance.

abstract serialize() str#
Return type

str

whylogs.core.relations.unescape_quote(input: str) str#
Parameters

input (str) –

Return type

str

whylogs.core.relations.unescape_colon(input: str) str#
Parameters

input (str) –

Return type

str

whylogs.core.relations.escape(input: str, target: str) str#
Parameters
  • input (str) –

  • target (str) –

Return type

str

class whylogs.core.relations.LiteralGetter(value: Union[str, int, float])#

Bases: ValueGetter

Helper class that provides a standard way to create an ABC using inheritance.

Parameters

value (Union[str, int, float]) –

serialize() str#
Return type

str

class whylogs.core.relations.Relation#

Bases: enum.Enum

Generic enumeration.

Derive from this class to define new enumerations.

no_op = 0#
match = 1#
fullmatch = 2#
equal = 3#
less = 4#
leq = 5#
greater = 6#
geq = 7#
neq = 8#
search = 13#
name()#

The name of the Enum member.

value()#

The value of the Enum member.

class whylogs.core.relations.Predicate(op: Relation = Relation.no_op, value: Union[str, int, float, ValueGetter] = 0, udf: Optional[Callable[[Any], bool]] = None, left: Optional[Predicate] = None, right: Optional[Predicate] = None, component: Optional[str] = None)#
Parameters
property not_: Predicate#
Return type

Predicate

matches(value: Union[str, int, float, ValueGetter]) Predicate#
Parameters

value (Union[str, int, float, ValueGetter]) –

Return type

Predicate

fullmatch(value: Union[str, int, float, ValueGetter]) Predicate#
Parameters

value (Union[str, int, float, ValueGetter]) –

Return type

Predicate

search(value: Union[str, int, float, ValueGetter]) Predicate#
Parameters

value (Union[str, int, float, ValueGetter]) –

Return type

Predicate

equals(value: Union[str, int, float, ValueGetter]) Predicate#
Parameters

value (Union[str, int, float, ValueGetter]) –

Return type

Predicate

less_than(value: Union[str, int, float, ValueGetter]) Predicate#
Parameters

value (Union[str, int, float, ValueGetter]) –

Return type

Predicate

less_or_equals(value: Union[str, int, float, ValueGetter]) Predicate#
Parameters

value (Union[str, int, float, ValueGetter]) –

Return type

Predicate

greater_than(value: Union[str, int, float, ValueGetter]) Predicate#
Parameters

value (Union[str, int, float, ValueGetter]) –

Return type

Predicate

greater_or_equals(value: Union[str, int, float, ValueGetter]) Predicate#
Parameters

value (Union[str, int, float, ValueGetter]) –

Return type

Predicate

not_equal(value: Union[str, int, float, ValueGetter]) Predicate#
Parameters

value (Union[str, int, float, ValueGetter]) –

Return type

Predicate

and_(right: Predicate) Predicate#
Parameters

right (Predicate) –

Return type

Predicate

or_(right: Predicate) Predicate#
Parameters

right (Predicate) –

Return type

Predicate

is_(udf: Callable[[Any], bool]) Predicate#
Parameters

udf (Callable[[Any], bool]) –

Return type

Predicate

serialize() str#
Return type

str

whylogs.core.relations.Not(p: Predicate) Predicate#
Parameters

p (Predicate) –

Return type

Predicate

whylogs.core.relations.Require(component: Optional[str] = None) Predicate#
Parameters

component (Optional[str]) –

Return type

Predicate