refactor: Do not emit any warnings in tests and treat warnings in tests as errors - #50
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Moritz Potthoff (MoritzPotthoffQC)
marked this pull request as ready for review
July 28, 2026 18:41
Moritz Potthoff (MoritzPotthoffQC)
requested review from
EgeKaraismailogluQC,
Marius Merkle (MariusMerkleQC) and
Oliver Borchert (borchero)
as code owners
July 28, 2026 18:41
Copilot started reviewing on behalf of
Moritz Potthoff (MoritzPotthoffQC)
July 28, 2026 18:41
View session
Contributor
There was a problem hiding this comment.
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=Trueto 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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