Skip to content

Commit 09a2415

Browse files
committed
Merge branch 'bug-panel-import-warnings' of https://github.com/htkim/pandas into htkim-bug-panel-import-warnings
Conflicts: doc/source/v0.15.0.txt
2 parents 0186cd2 + de4dbd0 commit 09a2415

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

doc/source/v0.15.0.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ Bug Fixes
556556
- Regression in multi-index indexing with a non-scalar type object (:issue:`7914`)
557557
- Bug in Timestamp comparisons with ``==`` and dtype of int64 (:issue:`8058`)
558558
- Bug in pickles contains ``DateOffset`` may raise ``AttributeError`` when ``normalize`` attribute is reffered internally (:issue:`7748`)
559-
559+
- Bug in Panel when using ``major_xs`` and ``copy=False`` is passed (deprecation warning fails because of missing ``warnings``) (:issue:`8152`).
560560
- Bug in pickle deserialization that failed for pre-0.14.1 containers with dup items trying to avoid ambiguity
561561
when matching block and manager items, when there's only one block there's no ambiguity (:issue:`7794`)
562562

@@ -668,4 +668,3 @@ Bug Fixes
668668

669669
- Bug in accessing groups from a ``GroupBy`` when the original grouper
670670
was a tuple (:issue:`8121`).
671-

pandas/core/panel.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
OrderedDefaultdict)
88
from pandas import compat
99
import sys
10+
import warnings
1011
import numpy as np
1112
from pandas.core.common import (PandasError, _try_sort, _default_index,
1213
_infer_dtype_from_scalar, notnull)

pandas/tests/test_panel.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
assert_frame_equal,
1919
assert_series_equal,
2020
assert_almost_equal,
21+
assert_produces_warning,
2122
ensure_clean,
2223
assertRaisesRegexp,
2324
makeCustomDataframe as mkdf,
@@ -2324,6 +2325,13 @@ def test_panel_index():
23242325
np.repeat([1, 2, 3], 4)])
23252326
assert(index.equals(expected))
23262327

2328+
2329+
def test_import_warnings():
2330+
# GH8152
2331+
panel = Panel(np.random.rand(3, 3, 3))
2332+
with assert_produces_warning():
2333+
panel.major_xs(1, copy=False)
2334+
23272335
if __name__ == '__main__':
23282336
import nose
23292337
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],

0 commit comments

Comments
 (0)