Skip to content

mecfs_bio.build_system.task.pipes.max_with_constant_pipe

Classes:

MaxWithConstantPipe

Bases: DataProcessingPipe

Methods:

Attributes:

col instance-attribute

col: str

new_col_name instance-attribute

new_col_name: str

value instance-attribute

value: float

process

process(x: LazyFrame) -> narwhals.LazyFrame
Source code in mecfs_bio/build_system/task/pipes/max_with_constant_pipe.py
def process(self, x: narwhals.LazyFrame) -> narwhals.LazyFrame:
    return x.with_columns(
        narwhals.max_horizontal(
            narwhals.col(self.col), narwhals.lit(self.value)
        ).alias(self.new_col_name)
    )