Skip to content

Fix deprecated Polars string cache calls (2.8.1) - #78

Merged
iskandr merged 2 commits into
masterfrom
fix/77-polars-string-cache
Sep 28, 2026
Merged

iskandr merged 2 commits into
masterfrom
fix/77-polars-string-cache

Conversation

@iskandr

@iskandr iskandr commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Reading a GTF on Polars 1.41+ emits a deprecated string-cache warning and fails when callers treat deprecations as errors. Skip the obsolete setter when polars.Categories is available; retain the shared cache on older Polars so categorical columns from separate reads remain compatible.

Add regression coverage for repeated pandas/Polars reads, categorical joins across separate lazy frames, and avoiding global cache setters on modern Polars. CI runs deprecations as errors and covers both sides of the Categories transition (1.31.0 and 1.32.0), alongside the latest compatible Polars on Python 3.9–3.11. Aggregate coverage from the three Python 3.11 Polars jobs so both modern and legacy paths count toward the coverage gate. Bump the package to 2.8.1.

Validation:

  • Reproduced the original failure with Polars 1.44.2 and -W error::DeprecationWarning.
  • ./lint.sh passes.
  • ./test.sh -W error::DeprecationWarning: 89 passed on Polars 1.44.2; 88 passed and 1 modern-only skip on Polars 1.31.0; 89 passed on Polars 1.32.0.

Fixes #77. Fixes #79.

Release verification (2026-09-28): merged as 46753d8; ./deploy.sh ran successfully from clean master, passing lint and all 89 tests. gtfparse 2.8.1 is published. Both PyPI artifact SHA-256 digests match the local build. Installing the published wheel into an isolated environment and reading pandas/Polars outputs with deprecations as errors also passed. All matrix CI jobs and combined coverage checks passed before merge.

@coveralls

coveralls commented Sep 28, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 36460031071

Coverage increased (+0.02%) to 95.635%

Details

  • Coverage increased (+0.02%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 4 coverage regressions across 1 file.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

4 previously-covered lines in 1 file lost coverage.

File Lines Losing Coverage Coverage
read_gtf.py 4 95.97%

Coverage Stats

Coverage Status
Relevant Lines: 252
Covered Lines: 241
Line Coverage: 95.63%
Coverage Strength: 2.86 hits per line

💛 - Coveralls

@iskandr
iskandr merged commit 46753d8 into master Sep 28, 2026
15 checks passed
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.

Aggregate coverage across Polars compatibility jobs read_gtf calls polars.enable_string_cache(), deprecated in polars 1.x

2 participants