Skip to content

Commit 4551d14

Browse files
committed
Added integration tests
1 parent 141ecb5 commit 4551d14

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

pandas/tests/test_integration.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,51 @@ def test_series_fillna_integration(self):
118118
expected = Series([1.0, 0.0, 3.0, 0.0, 5.0])
119119
pd.testing.assert_series_equal(result, expected)
120120

121+
class TestMallikarjunaIntegration:
122+
"""Integration tests by Mallikarjuna covering dtype_backend-libs interactions."""
123+
124+
def test_check_dtype_backend_with_lib_sentinel(self):
125+
"""Test check_dtype_backend with lib.no_default sentinel.
126+
127+
This exercises interaction between:
128+
- pandas.util._validators.check_dtype_backend
129+
- pandas._libs.lib.no_default (sentinel value)
130+
- validation of backend options
131+
"""
132+
# Should accept sentinel without exception
133+
check_dtype_backend(lib.no_default)
134+
135+
# Should accept valid backends
136+
check_dtype_backend("numpy_nullable")
137+
check_dtype_backend("pyarrow")
138+
139+
# Should reject unknown backend
140+
with pytest.raises(ValueError, match="dtype_backend .* is invalid"):
141+
check_dtype_backend("not_a_backend")
142+
143+
def test_percentile_validation_with_numpy_arrays(self):
144+
"""Test validate_percentile with numpy array interaction.
145+
146+
This exercises interaction between:
147+
- pandas.util._validators.validate_percentile
148+
- numpy array conversion and validation
149+
- pandas statistical methods that use percentiles
150+
"""
151+
# Single percentile as float
152+
result = validate_percentile(0.5)
153+
assert isinstance(result, np.ndarray)
154+
assert result == 0.5
155+
156+
# Multiple percentiles as list
157+
result = validate_percentile([0.25, 0.5, 0.75])
158+
expected = np.array([0.25, 0.5, 0.75])
159+
np.testing.assert_array_equal(result, expected)
160+
161+
# Invalid percentile should raise
162+
with pytest.raises(ValueError, match="percentiles should all be"):
163+
validate_percentile(1.5)
164+
165+
with pytest.raises(ValueError, match="percentiles should all be"):
166+
validate_percentile([0.25, 1.5, 0.75])
167+
168+

0 commit comments

Comments
 (0)