OperationControl
OperationControl is a Python class that defines the control parameters of some UpdateByOperations used in an update_by table operation. The UpdateByOperations can use OperationControl to handle erroneous data are:
Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
| on_null | BadDataBehavior | Defines how an
|
| on_nan | BadDataBehavior | Defines how an UpdateByOperation handles NaN values it encounters.
|
| big_value_context | MathContext | Defines how an UpdateByOperation handles exceptionally large values it encounters. The default value is
|
Returns
An instance of an OperationControl class that can be used in an update_by operation.
Examples
The following example does not set op_control, and thus uses the default settings of BadDataBehavior.SKIP and MathContext.DECIMAL128. Null values in the source table are skipped.
The following example sets op_control to use BadDataBehavior.RESET when null values occur, so that the EMA is reset when null values are encountered.
The following example sets op_control to use BadDataBehavior.RESET when NaN values occur, so that the EMA is reset when NaN values are encountered.
The following example sets op_control to use BadDataBehavior.POISON when NaN values occur. This results in the EMA being poisoned with NaN values.
The following example sets op_control to BadDataBehavior.THROW when null values occur. The query throws an error when it encounters a null value in the first row.