Skip to content

Commit f273bc4

Browse files
committed
mend
1 parent f43b3e2 commit f273bc4

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

doc/source/whatsnew/v3.0.0.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -814,10 +814,7 @@ I/O
814814
- Bug in :meth:`set_option` where setting the pandas option ``display.html.use_mathjax`` to ``False`` has no effect (:issue:`59884`)
815815
- Bug in :meth:`to_csv` where ``quotechar``` is not escaped when ``escapechar`` is not None (:issue:`61407`)
816816
- Bug in :meth:`to_excel` where :class:`MultiIndex` columns would be merged to a single row when ``merge_cells=False`` is passed (:issue:`60274`)
817-
- Bug in :func:`read_csv` with ``engine="python"`` and callable ``on_bad_lines``
818-
where a ``ParserWarning`` for extra fields returned by the callable was only
819-
raised when ``index_col`` was ``None``. Now the warning is consistently raised
820-
regardless of ``index_col`` (:issue:`#61837`)
817+
- Bug in :func:`read_csv` with ``engine="python"`` and callable ``on_bad_lines`` where a ``ParserWarning`` for extra fields returned by the callable was only raised when ``index_col`` was ``None``. Now the warning is consistently raised regardless of ``index_col`` (:issue:`#61837`)
821818

822819
Period
823820
^^^^^^

pandas/tests/arithmetic/test_numeric.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,25 @@ def test_div_negative_zero(self, zero, numeric_idx, op):
409409
result = op(idx, zero)
410410
tm.assert_index_equal(result, expected)
411411

412+
@pytest.mark.parametrize("dtype", tm.SIGNED_INT_EA_DTYPES)
413+
def test_numpy_array_mul_extension_array_returns_extension_array(dtype):
414+
data = np.arange(10)
415+
np_array = np.array(data).reshape(10, 1)
416+
ea_array = pd.array(data, dtype=dtype).reshape(10, 1)
417+
418+
# NumPy array * ExtensionArray
419+
result = np_array * ea_array
420+
421+
# Result should be an ExtensionArray, not a plain NumPy array
422+
assert hasattr(result, "dtype")
423+
# Check dtype is an ExtensionArray dtype (e.g. Int64Dtype)
424+
assert pd.api.types.is_extension_array_dtype(result.dtype)
425+
426+
# Also verify values match expected multiplication
427+
expected = pd.array(data * data, dtype=dtype).reshape(10, 1)
428+
tm.assert_extension_array_equal(result.ravel(), expected.ravel())
429+
430+
412431
# ------------------------------------------------------------------
413432

414433
@pytest.mark.parametrize("dtype1", [np.int64, np.float64, np.uint64])

0 commit comments

Comments
 (0)