From 372185e816dadd8d1a39977ae2c6abf7f61fbe32 Mon Sep 17 00:00:00 2001 From: Uriah Finkel Date: Thu, 20 Aug 2026 22:37:01 +0300 Subject: [PATCH 1/4] Add temporary Polars cleanup workflow --- .github/workflows/polars-count-temp.yml | 37 +++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/polars-count-temp.yml diff --git a/.github/workflows/polars-count-temp.yml b/.github/workflows/polars-count-temp.yml new file mode 100644 index 00000000..39407c6d --- /dev/null +++ b/.github/workflows/polars-count-temp.yml @@ -0,0 +1,37 @@ +name: Polars count cleanup + +on: + push: + branches: + - modernize/polars-count + +permissions: + contents: write + +jobs: + cleanup: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: modernize/polars-count + - name: Replace deprecated Polars count + shell: bash + run: | + python - <<'PY' + from pathlib import Path + path = Path('src/rtichoke/processing/adjustments.py') + text = path.read_text() + count = text.count('pl.count()') + if count != 2: + raise SystemExit(f'expected 2 pl.count() calls, found {count}') + path.write_text(text.replace('pl.count()', 'pl.len()')) + PY + - name: Commit cleanup + shell: bash + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add -- src/rtichoke/processing/adjustments.py + git commit -m "Replace deprecated Polars count" + git push From 27c48c1e18b65d0a14e7d36f9ddb8b371c0e1314 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 20 Aug 2026 19:37:09 +0000 Subject: [PATCH 2/4] Replace deprecated Polars count --- src/rtichoke/processing/adjustments.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rtichoke/processing/adjustments.py b/src/rtichoke/processing/adjustments.py index 4bb982b8..eafde726 100644 --- a/src/rtichoke/processing/adjustments.py +++ b/src/rtichoke/processing/adjustments.py @@ -129,7 +129,7 @@ def extract_crude_estimate_polars(data: pl.DataFrame) -> pl.DataFrame: all_combinations = data.select(["strata", "reals", "fixed_time_horizon"]).unique() counts = data.group_by(["strata", "reals", "fixed_time_horizon"]).agg( - pl.count().alias("reals_estimate") + pl.len().alias("reals_estimate") ) return all_combinations.join( @@ -420,7 +420,7 @@ def _create_adjusted_data_binary( adjusted_data_binary = ( long_df.group_by(["strata", "stratified_by", "reference_group", "reals_labels"]) - .agg(pl.count().alias("reals_estimate")) + .agg(pl.len().alias("reals_estimate")) .join(pl.DataFrame({"chosen_cutoff": breaks}), how="cross") ) From bbf58b90818cdae4fe497702a193fdab38bbf6ab Mon Sep 17 00:00:00 2001 From: Uriah Finkel Date: Thu, 20 Aug 2026 22:37:26 +0300 Subject: [PATCH 3/4] Trigger Polars cleanup workflow --- .github/workflows/polars-count-temp.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/polars-count-temp.yml b/.github/workflows/polars-count-temp.yml index 39407c6d..fa75fee1 100644 --- a/.github/workflows/polars-count-temp.yml +++ b/.github/workflows/polars-count-temp.yml @@ -35,3 +35,4 @@ jobs: git add -- src/rtichoke/processing/adjustments.py git commit -m "Replace deprecated Polars count" git push +# trigger From ef9432ba622ec6321585f3d46bad5314c772a7dd Mon Sep 17 00:00:00 2001 From: Uriah Finkel Date: Thu, 20 Aug 2026 22:37:33 +0300 Subject: [PATCH 4/4] Remove temporary Polars cleanup workflow --- .github/workflows/polars-count-temp.yml | 38 ------------------------- 1 file changed, 38 deletions(-) delete mode 100644 .github/workflows/polars-count-temp.yml diff --git a/.github/workflows/polars-count-temp.yml b/.github/workflows/polars-count-temp.yml deleted file mode 100644 index fa75fee1..00000000 --- a/.github/workflows/polars-count-temp.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Polars count cleanup - -on: - push: - branches: - - modernize/polars-count - -permissions: - contents: write - -jobs: - cleanup: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - ref: modernize/polars-count - - name: Replace deprecated Polars count - shell: bash - run: | - python - <<'PY' - from pathlib import Path - path = Path('src/rtichoke/processing/adjustments.py') - text = path.read_text() - count = text.count('pl.count()') - if count != 2: - raise SystemExit(f'expected 2 pl.count() calls, found {count}') - path.write_text(text.replace('pl.count()', 'pl.len()')) - PY - - name: Commit cleanup - shell: bash - run: | - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git add -- src/rtichoke/processing/adjustments.py - git commit -m "Replace deprecated Polars count" - git push -# trigger