Skip to content

Commit aad78d7

Browse files
committed
Removed import pd in test_scalar, updated test comments, whatsnew
1 parent f5feaad commit aad78d7

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

doc/source/whatsnew/v1.1.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ Indexing
262262
- Bug in :meth:`Series.xs` incorrectly returning ``Timestamp`` instead of ``datetime64`` in some object-dtype cases (:issue:`31630`)
263263
- Bug in :meth:`DataFrame.iat` incorrectly returning ``Timestamp`` instead of ``datetime`` in some object-dtype cases (:issue:`32809`)
264264
- Bug in :meth:`Series.loc` and :meth:`DataFrame.loc` when indexing with an integer key on a object-dtype :class:`Index` that is not all-integers (:issue:`31905`)
265-
-
265+
- Bug in :meth:`Series.at` when used with a :class:`MultiIndex` would raise an exception on valid inputs (:issue:`26989)
266266
267267
Missing
268268
^^^^^^^

pandas/tests/indexing/test_scalar.py

+10-7
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import numpy as np
55
import pytest
66

7-
import pandas as pd
87
from pandas import DataFrame, Series, Timedelta, Timestamp, date_range
98
import pandas._testing as tm
109
from pandas.tests.indexing.common import Base
@@ -306,28 +305,32 @@ def test_iat_dont_wrap_object_datetimelike():
306305

307306

308307
def test_tuple_indexed_series_at_get():
309-
series = pd.Series([1, 2], index=[(1, 2), (3, 4)])
308+
# GH 26989
309+
# Series.at works with MultiIndex
310+
series = Series([1, 2], index=[(1, 2), (3, 4)])
310311
assert series.at[1, 2] == 1
311312

312313

313314
def test_tuple_indexed_series_at_set():
314-
series = pd.Series([1, 2], index=[(1, 2), (3, 4)])
315+
# GH 26989
316+
# Series.at works with MultiIndex
317+
series = Series([1, 2], index=[(1, 2), (3, 4)])
315318
series.at[1, 2] = 3
316319
assert series.at[1, 2] == 3
317320

318321

319322
def test_multiindex_series_at_get():
320323
# GH 26989
321-
# series.at works with multiindex
322-
series = pd.Series([1, 2], index=[[1, 2], [3, 4]])
324+
# Series.at works with MultiIndex
325+
series = Series([1, 2], index=[[1, 2], [3, 4]])
323326
assert series.at[1, 3] == 1
324327
assert series.loc[1, 3] == 1
325328

326329

327330
def test_multiindex_series_at_set():
328331
# GH 26989
329-
# series.at works with multiindex
330-
series = pd.Series([1, 2], index=[[1, 2], [3, 4]])
332+
# Series.at works with MultiIndex
333+
series = Series([1, 2], index=[[1, 2], [3, 4]])
331334
series.at[1, 3] = 3
332335
assert series.at[1, 3] == 3
333336
series.loc[1, 3] = 4

0 commit comments

Comments
 (0)