Skip to main content

binary_operations

Binary (two reference arguments) transformations.

This module contains the base class and concrete classes for binary transformations, those that can take two reference arguments (i.e. column or transformation names).

Classes

AdditionTransformation

class AdditionTransformation(    *, name: str = None, output: bool = False, arg1: str, arg2: Union[float, str],):

Represents the addition of two columns or of a constant to a column.

Arguments

  • arg1: The first argument (column name).
  • arg2: The second argument (column name or numeric value).
  • name: The name of the transformation. If not provided a unique name will be generated from the class name.
  • output: Whether or not this transformation should be included in the final output. Defaults to False.

Raises

  • TransformationRegistryError: If the transformation name is already in use.
  • TransformationRegistryError: If the transformation name hasn't been provided and the transformation is not registered.

Method generated by attrs for class AdditionTransformation.

Static methods


schema

def schema()> marshmallow.schema.Schema:

Inherited from:

NumericBinaryOperation.schema :

Gets an instance of the Schema associated with this Transformation.

Raises

  • TypeError: If the transformation doesn't have a TransformationSchema as the schema.

BinaryOperation

class BinaryOperation(*, name: str = None, output: bool = False, arg1: Any, arg2: Any):

Base two-arg transformation.

The base abstract class for all Binary Operation Transformations.

Arguments

  • arg1: The first argument
  • arg2: The second argument
  • name: The name of the transformation. If not provided a unique name will be generated from the class name.
  • output: Whether or not this transformation should be included in the final output. Defaults to False.

Raises

  • TransformationRegistryError: If the transformation name is already in use.
  • TransformationRegistryError: If the transformation name hasn't been provided and the transformation is not registered.

Method generated by attrs for class BinaryOperation.

Variables

  • static arg1 : Any
  • static arg2 : Any

Static methods


schema

def schema()> marshmallow.schema.Schema:

Inherited from:

Transformation.schema :

Gets an instance of the Schema associated with this Transformation.

Raises

  • TypeError: If the transformation doesn't have a TransformationSchema as the schema.

ComparisonTransformation

class ComparisonTransformation(    *, name: str = None, output: bool = False, arg1: str, arg2: Union[float, str],):

Represents the comparison between two columns or of one column and a constant.

The resulting output should be: - -1 if arg1 < arg2 - 0 if arg1 == arg2 - +1 if arg1 > arg2.

Arguments

  • arg1: The first argument (column name).
  • arg2: The second argument (column name or numeric value).
  • name: The name of the transformation. If not provided a unique name will be generated from the class name.
  • output: Whether or not this transformation should be included in the final output. Defaults to False.

Raises

  • TransformationRegistryError: If the transformation name is already in use.
  • TransformationRegistryError: If the transformation name hasn't been provided and the transformation is not registered.

Method generated by attrs for class ComparisonTransformation.

Static methods


schema

def schema()> marshmallow.schema.Schema:

Inherited from:

NumericBinaryOperation.schema :

Gets an instance of the Schema associated with this Transformation.

Raises

  • TypeError: If the transformation doesn't have a TransformationSchema as the schema.

DivisionTransformation

class DivisionTransformation(    *, name: str = None, output: bool = False, arg1: str, arg2: Union[float, str],):

Column division transformation.

Represents the division of one column by another or of one column by a constant.

Arguments

  • arg1: The first argument (column name).
  • arg2: The second argument (column name or numeric value).
  • name: The name of the transformation. If not provided a unique name will be generated from the class name.
  • output: Whether or not this transformation should be included in the final output. Defaults to False.

Raises

  • TransformationRegistryError: If the transformation name is already in use.
  • TransformationRegistryError: If the transformation name hasn't been provided and the transformation is not registered.

Method generated by attrs for class DivisionTransformation.

Static methods


schema

def schema()> marshmallow.schema.Schema:

Inherited from:

NumericBinaryOperation.schema :

Gets an instance of the Schema associated with this Transformation.

Raises

  • TypeError: If the transformation doesn't have a TransformationSchema as the schema.

MultiplicationTransformation

class MultiplicationTransformation(    *, name: str = None, output: bool = False, arg1: str, arg2: Union[float, str],):

Represents the multiplication of two columns or of a column and a constant.

Arguments

  • arg1: The first argument (column name).
  • arg2: The second argument (column name or numeric value).
  • name: The name of the transformation. If not provided a unique name will be generated from the class name.
  • output: Whether or not this transformation should be included in the final output. Defaults to False.

Raises

  • TransformationRegistryError: If the transformation name is already in use.
  • TransformationRegistryError: If the transformation name hasn't been provided and the transformation is not registered.

Method generated by attrs for class MultiplicationTransformation.

Static methods


schema

def schema()> marshmallow.schema.Schema:

Inherited from:

NumericBinaryOperation.schema :

Gets an instance of the Schema associated with this Transformation.

Raises

  • TypeError: If the transformation doesn't have a TransformationSchema as the schema.

NumericBinaryOperation

class NumericBinaryOperation(    *, name: str = None, output: bool = False, arg1: str, arg2: Union[float, str],):

Base two-arg operation involving numbers.

This class represents any BinaryOperation where arg2 can be numeric or a second column name such as addition, multiplication, etc.

Arguments

  • arg1: The first argument (column name).
  • arg2: The second argument (column name or numeric value).
  • name: The name of the transformation. If not provided a unique name will be generated from the class name.
  • output: Whether or not this transformation should be included in the final output. Defaults to False.

Raises

  • TransformationRegistryError: If the transformation name is already in use.
  • TransformationRegistryError: If the transformation name hasn't been provided and the transformation is not registered.

Method generated by attrs for class NumericBinaryOperation.

Variables

  • static arg1 : str
  • static arg2 : Union[float, str]

Static methods


schema

def schema()> marshmallow.schema.Schema:

Inherited from:

BinaryOperation.schema :

Gets an instance of the Schema associated with this Transformation.

Raises

  • TypeError: If the transformation doesn't have a TransformationSchema as the schema.

SubtractionTransformation

class SubtractionTransformation(    *, name: str = None, output: bool = False, arg1: str, arg2: Union[float, str],):

Column subtracting transformation.

Represents the subtraction of one column from another or of a constant from a column.

Arguments

  • arg1: The first argument (column name).
  • arg2: The second argument (column name or numeric value).
  • name: The name of the transformation. If not provided a unique name will be generated from the class name.
  • output: Whether or not this transformation should be included in the final output. Defaults to False.

Raises

  • TransformationRegistryError: If the transformation name is already in use.
  • TransformationRegistryError: If the transformation name hasn't been provided and the transformation is not registered.

Method generated by attrs for class SubtractionTransformation.

Static methods


schema

def schema()> marshmallow.schema.Schema:

Inherited from:

NumericBinaryOperation.schema :

Gets an instance of the Schema associated with this Transformation.

Raises

  • TypeError: If the transformation doesn't have a TransformationSchema as the schema.