Skip to content

mecfs_bio.build_system.task.pipes.set_col_pipe

Classes:

SetColToConstantPipe

Bases: DataProcessingPipe

Methods:

Attributes:

col_name instance-attribute

col_name: str

constant instance-attribute

constant: str | int | float

process

process(x: LazyFrame) -> narwhals.LazyFrame
Source code in mecfs_bio/build_system/task/pipes/set_col_pipe.py
def process(self, x: narwhals.LazyFrame) -> narwhals.LazyFrame:
    return x.with_columns(narwhals.lit(self.constant).alias(self.col_name))