Skip to content

CI: provision Python via simple_python(); pin pandas<3 - #7

Open
jefferis wants to merge 2 commits into
mainfrom
ci-provision-pandas-pin
Open

CI: provision Python via simple_python(); pin pandas<3#7
jefferis wants to merge 2 commits into
mainfrom
ci-provision-pandas-pin

Conversation

@jefferis

Copy link
Copy Markdown
Member

Provisions Python in CI through nat.python's own simple_python() — the exact end-user path — instead of a bespoke reticulate::py_install() call, and pins the baseline to pandas < 3 for now.

Why

On PR #6, coverage came out at 47.6% (vs an estimated 66%): a conda-forge pandas 3.0.5 build would not import against the installed numpy, and the test helper collapsed "installed but import fails" into "absent", so five convert tests silently skipped rather than failing. This branch fixes both the provisioning and the diagnostic gap.

Changes

  • .github/workflows/{R-CMD-check,test-coverage}.yaml — install nat.python via pak::local_install(), then provision with simple_python("minimal") (coverage leg adds pyarrow), and pin RETICULATE_PYTHON for the run.
  • tests/testthat/helper-nat.python.Rpy_module_status() distinguishes ok / broken / absent; skip_if_no_module() now errors when a module is installed but fails to import, and only skips when genuinely absent — so a broken install can never masquerade as a skip again.
  • R/env.Rsimple_python() pins the baseline to pandas < 3 for now (ecosystem caution while pandas 3 settles).

pandas 3 support in pandas2df() (and lifting this pin) is handled separately in the stacked pandas3-support branch.

Provision CI Python through nat.python's own simple_python() engine (pip
pandas into the managed r-reticulate env) instead of reticulate::py_install(),
which pulled a conda-forge pandas 3.0.5 that would not import against numpy
2.5.2 -- silently skipping every pandas2df() test and dropping coverage.

The test helper now distinguishes an absent module (skip) from one that is
installed but fails to import (error, surfacing the Python error) so a broken
environment can no longer masquerade as a benign skip.
pandas 3.0 defaults string columns to Arrow-backed dtype when pyarrow is
present; pandas2df() does not yet convert ArrowStringArray back to R, so string
columns returned as raw python objects and the fast-path tests failed. Pin the
baseline until pandas2df() gains Arrow-string support.
@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.18%. Comparing base (e0adbaf) to head (f226dda).

Files with missing lines Patch % Lines
R/env.R 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main       #7       +/-   ##
===========================================
+ Coverage   47.62%   66.18%   +18.55%     
===========================================
  Files           6        6               
  Lines         485      485               
===========================================
+ Hits          231      321       +90     
+ Misses        254      164       -90     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant