tlc.core.operations.operation¶
This module provides an abstract base class for operations and its specialized subclasses.
The Operation class serves as an abstract base class for different types of operations
that can be applied to tables.
Operation: Abstract base class for table operations.LocalOperation: Specialized class for operations acting on individual rows.GlobalOperation: Specialized class for operations acting on entire columns.
Module Contents¶
Classes¶
Class |
Description |
|---|---|
Represents the context in which a value is calculated. |
|
Represents the context in which a schema is calculated. |
|
An abstract base class representing a generic operation on data. |
|
An abstract base class representing a local operation on data. |
|
An abstract base class representing a global operation on data. |
API¶
- class CalculateValueContext( )¶
Represents the context in which a value is calculated.
- class CalculateSchemaContext( )¶
Represents the context in which a schema is calculated.
- class Operation¶
Bases:
abc.ABCAn abstract base class representing a generic operation on data.
Subclasses must implement the
calculate_schemaas well as eitherpopulate_column_datafor global operations orcalculate_single_valuefor local operations.- abstract calculate_schema(
- calculate_schema_context: CalculateSchemaContext,
Calculate the schema for the resulting table based on input schemas.
- abstract populate_column_data(
- calculate_value_context: CalculateValueContext,
Populate column data based on the operation and input table.
- class LocalOperation¶
Bases:
tlc.core.operations.operation.OperationAn abstract base class representing a local operation on data.
Subclasses must implement the
calculate_single_valuemethod.- abstract calculate_single_value(
- row: Mapping[str, object],
- calculate_value_context: CalculateValueContext,
Calculate a single value for a row based on the operation.
- populate_column_data(
- calculate_value_context: CalculateValueContext,
Populate a list of values for a new column in the table.
- class GlobalOperation¶
Bases:
tlc.core.operations.operation.OperationAn abstract base class representing a global operation on data.
Acts on entire columns of data.