cycquery.ops.FillNull

class FillNull(cols, fill_values, new_col_names=None)[source]

Bases: QueryOp

Fill NULL values with a given value.

Parameters:

Examples

>>> FillNull("col1", 0)(table)
>>> FillNull(["col1", "col2"], [0, 1])(table)
>>> FillNull(["col1", "col2"], [0, 1], ["col1_new", "col2_new"])(table)

Initialize the operation.

Methods

__call__(table)[source]

Fill NULL values with a given value.

Parameters:

table (Union[Select, Subquery, Table, DBTable]) – Table on which to perform the operation.

Returns:

Table with NULL values filled.

Return type:

Subquery

__init__(cols, fill_values, new_col_names=None)[source]

Initialize the operation.