Skip to content

refactor: Do not emit any warnings in tests and treat warnings in tests as errors - #50

Merged
Moritz Potthoff (MoritzPotthoffQC) merged 3 commits into
mainfrom
polars-warning
Jul 28, 2026
Merged

refactor: Do not emit any warnings in tests and treat warnings in tests as errors#50
Moritz Potthoff (MoritzPotthoffQC) merged 3 commits into
mainfrom
polars-warning

Conversation

@MoritzPotthoffQC

@MoritzPotthoffQC Moritz Potthoff (MoritzPotthoffQC) commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Motivation

Currently, we emit warnings from package code in new polars versions. I think we should not (e.g., as consumers might treat them as errors)

Changes

  • Treat warnings as errors, with one exception
  • Fix code

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (a0158ce) to head (74bd653).

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #50   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           13        13           
  Lines         1140      1140           
=========================================
  Hits          1140      1140           

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens the project’s warning discipline by treating warnings as errors during pytest runs, and adjusts Polars expression usage to avoid warnings from newer Polars versions.

Changes:

  • Configure pytest to treat warnings as errors, with an explicit exception for a known Polars deprecation warning.
  • Update a Polars list/array explode usage to pass empty_as_null=True to avoid warning-prone behavior changes.
  • Materialize itertools.zip_longest(...) into lists for pytest parametrization stability (avoids iterator-related warnings/collection quirks).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/test_fraction_same.py Wraps zip_longest argvalues in list(...) for deterministic pytest parametrization without iterator-related warnings.
pyproject.toml Enables warnings-as-errors for pytest and adds an explicit ignore for a specific Polars deprecation warning.
diffly/comparison.py Adjusts Expr.explode(...) calls to use empty_as_null=True to align with newer Polars behavior and reduce warnings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pyproject.toml

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@MoritzPotthoffQC
Moritz Potthoff (MoritzPotthoffQC) merged commit 05b4df9 into main Jul 28, 2026
23 checks passed
@MoritzPotthoffQC
Moritz Potthoff (MoritzPotthoffQC) deleted the polars-warning branch July 28, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants