Skip to content
2 changes: 1 addition & 1 deletion pandas/io/excel/_xlsxwriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def __init__( # pyright: ignore[reportInconsistentConstructor]
)

try:
self._book = Workbook(self._handles.handle, **engine_kwargs) # type: ignore[arg-type]
self._book = Workbook(self._handles.handle, **engine_kwargs)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

i removed type: ignore as it was showing ci check fail.

except TypeError:
self._handles.handle.close()
raise
Expand Down
14 changes: 14 additions & 0 deletions pandas/tests/util/test_shares_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,17 @@ def test_shares_memory_string():

obj = pd.array(["a", "b"], dtype=pd.ArrowDtype(pa.string()))
assert tm.shares_memory(obj, obj)


def test_shares_memory_numpy():
arr = np.arange(10)
view = arr[:5]
assert tm.shares_memory(arr, view)
arr2 = np.arange(10)
assert not tm.shares_memory(arr, arr2)


def test_shares_memory_rangeindex():
idx = pd.RangeIndex(10)
arr = np.arange(10)
assert not tm.shares_memory(idx, arr)
Loading