From f2442a8fdd2e73d00899c69fde1774462dd220f6 Mon Sep 17 00:00:00 2001 From: "S.Nakano" <35072092+sumeshi@users.noreply.github.com> Date: Fri, 24 Jan 2025 17:00:56 +0000 Subject: [PATCH] fix: replace to replace_all --- pyproject.toml | 2 +- src/qsv/operations/chainables/sed.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d93222f..ac96f67 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "qsv" -version = "0.4.1" +version = "0.4.2" description = "A tool that provides elastic and rapid filtering for efficient analysis of huge CSV files, such as eventlogs." readme = "README.md" authors = [ diff --git a/src/qsv/operations/chainables/sed.py b/src/qsv/operations/chainables/sed.py index ac74a25..e9bcea7 100644 --- a/src/qsv/operations/chainables/sed.py +++ b/src/qsv/operations/chainables/sed.py @@ -11,5 +11,5 @@ def sed(df: pl.LazyFrame, colname: str, pattern: str, replacement: str, ignoreca LogController.debug(f"sed condition: {pattern} on {colname}") pattern = pattern if type(pattern) is str else str(pattern) return df.with_columns( - pl.col(colname).cast(pl.String).str.replace(f"(?i){pattern}", replacement) if ignorecase else pl.col(colname).cast(pl.String).str.replace(pattern, replacement) + pl.col(colname).cast(pl.String).str.replace_all(f"(?i){pattern}", replacement) if ignorecase else pl.col(colname).cast(pl.String).str.replace_all(pattern, replacement) )