-
Notifications
You must be signed in to change notification settings - Fork 102
test: refactor test_data_color_utils.py
through parametrization
#740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
test: refactor test_data_color_utils.py
through parametrization
#740
Conversation
@@ -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] |
There was a problem hiding this comment.
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
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
@rich-iannone do you mind reviewing this? |
PdSeries = pd.Series | ||
PdSeries = pd.Series[Any] | ||
PlSeries = pl.Series | ||
PyArrowArray = pa.Array | ||
PyArrowChunkedArray = pa.ChunkedArray | ||
PyArrowArray = pa.Array[Any] | ||
PyArrowChunkedArray = pa.ChunkedArray[Any] |
There was a problem hiding this comment.
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
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