Skip to content

Unify builtin comparison checks with Narwhals impl - #2207

Draft
deepyaman wants to merge 2 commits into
unionai-oss:mainfrom
deepyaman:refactor/narwhalify
Draft

Unify builtin comparison checks with Narwhals impl#2207
deepyaman wants to merge 2 commits into
unionai-oss:mainfrom
deepyaman:refactor/narwhalify

Conversation

@deepyaman

@deepyaman deepyaman commented Jan 20, 2026

Copy link
Copy Markdown
Collaborator

Refactor builtin check implementations for Polars and Ibis to use Narwhals as a common abstraction layer, enabling code sharing between backends. This change implements equal_to, not_equal_to, greater_than, greater_than_or_equal_to, less_than, and less_than_or_equal_to checks using Narwhals.

  • Add narwhals dependency to polars and ibis optional dependency groups
  • Add CheckData protocol with frame and key properties for type safety
  • Add frame property to PolarsData and IbisData for uniform access
  • Replace NotImplementedError stubs in base with Narwhals implementations
  • Update Polars and Ibis backends to delegate to base implementations

@deepyaman
deepyaman force-pushed the refactor/narwhalify branch from ce7208a to 6002ae9 Compare January 20, 2026 06:28
@codecov

codecov Bot commented Jan 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 24.59016% with 46 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.42%. Comparing base (71f860a) to head (43f3435).
⚠️ Report is 206 commits behind head on main.

Files with missing lines Patch % Lines
pandera/backends/base/builtin_checks.py 33.33% 18 Missing ⚠️
pandera/backends/ibis/builtin_checks.py 0.00% 12 Missing ⚠️
pandera/backends/polars/builtin_checks.py 0.00% 8 Missing ⚠️
pandera/api/ibis/types.py 0.00% 3 Missing ⚠️
pandera/api/polars/types.py 0.00% 3 Missing ⚠️
pandera/api/base/types.py 75.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2207       +/-   ##
===========================================
- Coverage   83.76%   64.42%   -19.34%     
===========================================
  Files         137      137               
  Lines       10715    10750       +35     
===========================================
- Hits         8975     6926     -2049     
- Misses       1740     3824     +2084     

☔ 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.

@deepyaman
deepyaman force-pushed the refactor/narwhalify branch 2 times, most recently from b573161 to cf33669 Compare January 20, 2026 07:12
Refactor builtin check implementations for Polars to use Narwhals as a
common abstraction layer, enabling code sharing between backends. This
change implements equal_to, not_equal_to, greater_than, greater_than_or_equal_to,
less_than, and less_than_or_equal_to checks using Narwhals.

- Add narwhals dependency to polars and ibis optional dependency groups
- Add CheckData protocol with frame and key properties for type safety
- Add frame property to PolarsData and IbisData for uniform access
- Replace NotImplementedError stubs in base with Narwhals implementations
- Update Polars backend to delegate to base implementations
- Ibis backend unchanged (keeps timedelta preprocessing)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Deepyaman Datta <deepyaman.datta@utexas.edu>
@deepyaman
deepyaman force-pushed the refactor/narwhalify branch from cf33669 to f873f5a Compare January 20, 2026 07:13
Signed-off-by: Deepyaman Datta <deepyaman.datta@utexas.edu>
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