Skip to content

Conversation

FBruzzesi
Copy link
Contributor

Summary

As per title: this PR aims to refactor test_data_color_utils by exploiting pytest parametrization.

On top of it, it sets up the stage for a dataframe constructor fixture to be used elsewhere (e.g. follow up on test_data_color.py to test with all backends)

Checklist

@@ -759,7 +759,7 @@ def _(df: PyArrowTable, x: Any) -> bool:
import pyarrow as pa

arr = pa.array([x])
return arr.is_null().to_pylist()[0] or arr.is_nan().to_pylist()[0]
return arr.is_null(nan_is_null=True).to_pylist()[0]
Copy link
Contributor Author

@FBruzzesi FBruzzesi Jul 30, 2025

Choose a reason for hiding this comment

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

Reason for this change is that .is_nan raises an exception for non-numeric arrays. It was not tested for pyarrow before

Copy link

codecov bot commented Jul 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.45%. Comparing base (bf2ae77) to head (c172954).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #740      +/-   ##
==========================================
+ Coverage   91.43%   91.45%   +0.01%     
==========================================
  Files          47       47              
  Lines        5547     5547              
==========================================
+ Hits         5072     5073       +1     
+ Misses        475      474       -1     

☔ View full report in Codecov by Sentry.
📢 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.

@machow
Copy link
Collaborator

machow commented Jul 31, 2025

@rich-iannone do you mind reviewing this?

Comment on lines -32 to +35
PdSeries = pd.Series
PdSeries = pd.Series[Any]
PlSeries = pl.Series
PyArrowArray = pa.Array
PyArrowChunkedArray = pa.ChunkedArray
PyArrowArray = pa.Array[Any]
PyArrowChunkedArray = pa.ChunkedArray[Any]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reason for this is that I was getting warnings that

SeriesLike is partially unknown

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.

2 participants