great-tables icon indicating copy to clipboard operation
great-tables copied to clipboard

fix: update Polars selector type annotation to use `Selector`

Open schmidma opened this issue 7 months ago • 2 comments

Summary

This PR fixes a type annotation issue with Polars selectors. Polars introduced a new Selector class. As a result, the current import of _selector_proxy_ in great-tables fails when using at least version 1.32.0 of Polars.

Without this change, type-checking great-tables with recent Polars versions fails due to missing _selector_proxy_.

Changes

  • Replaced _selector_proxy_ with Selector
  • Updated type alias: PlSelectExpr = Selector

Notes

  • This is a type-checking only change; no runtime behavior is affected.
  • Verified with latest Polars release where Selector is available.

Related GitHub Issues and PRs

  • https://github.com/pola-rs/polars/pull/23351

Checklist

  • [x] I understand and agree to the Code of Conduct.
  • [x] I have followed the Style Guide for Python Code as best as possible for the submitted code.
  • ~~[ ] I have added pytest unit tests for any new functionality.~~

schmidma avatar Sep 01 '25 13:09 schmidma

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 91.45%. Comparing base (654757a) to head (24dcd96).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #770   +/-   ##
=======================================
  Coverage   91.45%   91.45%           
=======================================
  Files          47       47           
  Lines        5558     5558           
=======================================
  Hits         5083     5083           
  Misses        475      475           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Sep 03 '25 09:09 codecov[bot]

@rich-iannone and @machow, perhaps we should use a try-import here to handle the compatibility issue.

jrycw avatar Sep 03 '25 09:09 jrycw