Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: remove moar warnings #17872

Merged
merged 5 commits into from
Oct 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pandas/core/dtypes/missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,12 @@ def array_equivalent(left, right, strict_nan=False):
left = left.view('i8')
right = right.view('i8')

# if we have structured dtypes, compare first
if (left.dtype.type is np.void or
right.dtype.type is np.void):
if left.dtype != right.dtype:
return False

return np.array_equal(left, right)


Expand Down
1 change: 0 additions & 1 deletion pandas/tests/io/test_gbq.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ def make_mixed_dataframe_v2(test_size):
index=range(test_size))


@pytest.mark.xfail(reason="gbq having issues")
@pytest.mark.single
class TestToGBQIntegrationWithServiceAccountKeyPath(object):

Expand Down
53 changes: 10 additions & 43 deletions pandas/tests/io/test_pytables.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import pytest
import sys
import os
import tempfile
from contextlib import contextmanager
Expand All @@ -16,7 +15,8 @@
date_range, timedelta_range, Index, DatetimeIndex,
isna)

from pandas.compat import is_platform_windows, PY3, PY35, BytesIO, text_type
from pandas.compat import (is_platform_windows, is_platform_little_endian,
PY3, PY35, PY36, BytesIO, text_type)
from pandas.io.formats.printing import pprint_thing
from pandas.core.dtypes.common import is_categorical_dtype

Expand Down Expand Up @@ -1042,11 +1042,10 @@ def check(format, index):
with catch_warnings(record=True):
check('fixed', index)

@pytest.mark.skipif(not is_platform_little_endian(),
reason="reason platform is not little endian")
def test_encoding(self):

if sys.byteorder != 'little':
pytest.skip('system byteorder is not little')

with ensure_clean_store(self.path) as store:
df = DataFrame(dict(A='foo', B='bar'), index=range(5))
df.loc[2, 'A'] = np.nan
Expand Down Expand Up @@ -2887,9 +2886,6 @@ def test_index_types(self):

def test_timeseries_preepoch(self):

if sys.version_info[0] == 2 and sys.version_info[1] < 7:
pytest.skip("won't work on Python < 2.7")

dr = bdate_range('1/1/1940', '1/1/1960')
ts = Series(np.random.randn(len(dr)), index=dr)
try:
Expand Down Expand Up @@ -4274,13 +4270,11 @@ def test_select_as_multiple(self):
['df1', 'df3'], where=['A>0', 'B>0'],
selector='df1')

@pytest.mark.skipf(
LooseVersion(tables.__version__) < '3.1.0',
"tables version does not support fix for nan selection bug: GH 4858")
def test_nan_selection_bug_4858(self):

# GH 4858; nan selection bug, only works for pytables >= 3.1
if LooseVersion(tables.__version__) < '3.1.0':
pytest.skip('tables version does not support fix for nan '
'selection bug: GH 4858')

with ensure_clean_store(self.path) as store:

df = DataFrame(dict(cols=range(6), values=range(6)),
Expand Down Expand Up @@ -4598,11 +4592,9 @@ def test_pytables_native_read(self):
d2 = store['detector/readout']
assert isinstance(d2, DataFrame)

@pytest.mark.skipif(PY35 and is_platform_windows(),
reason="native2 read fails oddly on windows / 3.5")
def test_pytables_native2_read(self):
# fails on win/3.5 oddly
if PY35 and is_platform_windows():
pytest.skip("native2 read fails oddly on windows / 3.5")

with ensure_clean_store(
tm.get_data_path('legacy_hdf/pytables_native2.h5'),
mode='r') as store:
Expand Down Expand Up @@ -4690,31 +4682,6 @@ def do_copy(f, new_f=None, keys=None,
finally:
safe_remove(path)

def test_legacy_table_write(self):
pytest.skip("cannot write legacy tables")

store = HDFStore(tm.get_data_path(
'legacy_hdf/legacy_table_%s.h5' % pandas.__version__), 'a')

df = tm.makeDataFrame()
with catch_warnings(record=True):
wp = tm.makePanel()

index = MultiIndex(levels=[['foo', 'bar', 'baz', 'qux'],
['one', 'two', 'three']],
labels=[[0, 0, 0, 1, 1, 2, 2, 3, 3, 3],
[0, 1, 2, 0, 1, 1, 2, 0, 1, 2]],
names=['foo', 'bar'])
df = DataFrame(np.random.randn(10, 3), index=index,
columns=['A', 'B', 'C'])
store.append('mi', df)

df = DataFrame(dict(A='foo', B='bar'), index=lrange(10))
store.append('df', df, data_columns=['B'], min_itemsize={'A': 200})
store.append('wp', wp)

store.close()

def test_store_datetime_fractional_secs(self):

with ensure_clean_store(self.path) as store:
Expand Down Expand Up @@ -5260,7 +5227,7 @@ def test_read_hdf_series_mode_r(self, format):
result = pd.read_hdf(path, key='data', mode='r')
tm.assert_series_equal(result, series)

@pytest.mark.skipif(sys.version_info < (3, 6), reason="Need python 3.6")
@pytest.mark.skipif(not PY36, reason="Need python 3.6")
def test_fspath(self):
with tm.ensure_clean('foo.h5') as path:
with pd.HDFStore(path) as store:
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/test_algos.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ def test_duplicated_with_nas(self):
2, 4, 1, 5, 6]),
np.array([1.1, 2.2, 1.1, np.nan, 3.3,
2.2, 4.4, 1.1, np.nan, 6.6]),
pytest.mark.xfail(resaon="Complex bug. GH 16399")(
pytest.mark.xfail(reason="Complex bug. GH 16399")(
np.array([1 + 1j, 2 + 2j, 1 + 1j, 5 + 5j, 3 + 3j,
2 + 2j, 4 + 4j, 1 + 1j, 5 + 5j, 6 + 6j])
),
Expand Down