cycquery.ops.DropEmpty

class DropEmpty(cols)[source]

Bases: QueryOp

Remove rows with empty values in some specified columns.

Parameters:

cols (Union[str, List[str]]) – Columns in which, if a value is empty, the corresponding row is removed.

Examples

>>> DropEmpty("col1")(table)
>>> DropEmpty(["col1", "col2"])(table)

Initialize the operation.

Methods

__call__(table)[source]

Process the table.

Parameters:

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

Returns:

Processed table.

Return type:

sqlalchemy.sql.selectable.Subquery

__init__(cols)[source]

Initialize the operation.