Skip to content

COMPAT: 3.6 #14679

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

Closed
jreback opened this issue Nov 17, 2016 · 8 comments
Closed

COMPAT: 3.6 #14679

jreback opened this issue Nov 17, 2016 · 8 comments
Labels
Compat pandas objects compatability with Numpy or Python functions
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Nov 17, 2016

after #14678

Bunch of Deprecation Warnings

/home/travis/build/jreback/pandas/pandas/io/tests/json/test_pandas.py:974: DeprecationWarning: invalid escape sequence \[
  TypeError, '\[unicode\] is not implemented as a table column')

only a small number of 3.6 failures remain.

======================================================================
ERROR: pandas.io.tests.test_pickle.TestPickle.test_round_trip_current
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/jreback/pandas/pandas/io/pickle.py", line 52, in try_read
    return pkl.load(fh)
  File "pandas/tslib.pyx", line 407, in pandas.tslib.Timestamp.__new__ (pandas/tslib.c:10434)
    ts = convert_to_tsobject(ts_input, tz, unit, 0, 0)
  File "pandas/tslib.pyx", line 1542, in pandas.tslib.convert_to_tsobject (pandas/tslib.c:28780)
    raise TypeError('Cannot convert input to Timestamp')
TypeError: Cannot convert input to Timestamp
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/travis/build/jreback/pandas/pandas/io/pickle.py", line 57, in try_read
    return pc.load(fh, encoding=encoding, compat=False)
  File "/home/travis/build/jreback/pandas/pandas/compat/pickle_compat.py", line 117, in load
    return up.load()
  File "/home/travis/miniconda/envs/pandas/lib/python3.6/pickle.py", line 1050, in load
    dispatch[key[0]](self)
  File "/home/travis/build/jreback/pandas/pandas/compat/pickle_compat.py", line 21, in load_reduce
    stack[-1] = func(*args)
  File "pandas/tslib.pyx", line 407, in pandas.tslib.Timestamp.__new__ (pandas/tslib.c:10434)
    ts = convert_to_tsobject(ts_input, tz, unit, 0, 0)
  File "pandas/tslib.pyx", line 1542, in pandas.tslib.convert_to_tsobject (pandas/tslib.c:28780)
    raise TypeError('Cannot convert input to Timestamp')
TypeError: Cannot convert input to Timestamp
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/travis/build/jreback/pandas/pandas/io/pickle.py", line 65, in read_pickle
    return try_read(path)
  File "/home/travis/build/jreback/pandas/pandas/io/pickle.py", line 62, in try_read
    return pc.load(fh, encoding=encoding, compat=True)
  File "/home/travis/build/jreback/pandas/pandas/compat/pickle_compat.py", line 117, in load
    return up.load()
  File "/home/travis/miniconda/envs/pandas/lib/python3.6/pickle.py", line 1050, in load
    dispatch[key[0]](self)
  File "/home/travis/build/jreback/pandas/pandas/compat/pickle_compat.py", line 21, in load_reduce
    stack[-1] = func(*args)
  File "pandas/tslib.pyx", line 407, in pandas.tslib.Timestamp.__new__ (pandas/tslib.c:10434)
    ts = convert_to_tsobject(ts_input, tz, unit, 0, 0)
  File "pandas/tslib.pyx", line 1542, in pandas.tslib.convert_to_tsobject (pandas/tslib.c:28780)
    raise TypeError('Cannot convert input to Timestamp')
TypeError: Cannot convert input to Timestamp
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/travis/build/jreback/pandas/pandas/io/pickle.py", line 52, in try_read
    return pkl.load(fh)
  File "pandas/tslib.pyx", line 407, in pandas.tslib.Timestamp.__new__ (pandas/tslib.c:10434)
    ts = convert_to_tsobject(ts_input, tz, unit, 0, 0)
  File "pandas/tslib.pyx", line 1542, in pandas.tslib.convert_to_tsobject (pandas/tslib.c:28780)
    raise TypeError('Cannot convert input to Timestamp')
TypeError: Cannot convert input to Timestamp
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/travis/build/jreback/pandas/pandas/io/pickle.py", line 57, in try_read
    return pc.load(fh, encoding=encoding, compat=False)
  File "/home/travis/build/jreback/pandas/pandas/compat/pickle_compat.py", line 117, in load
    return up.load()
  File "/home/travis/miniconda/envs/pandas/lib/python3.6/pickle.py", line 1050, in load
    dispatch[key[0]](self)
  File "/home/travis/build/jreback/pandas/pandas/compat/pickle_compat.py", line 21, in load_reduce
    stack[-1] = func(*args)
  File "pandas/tslib.pyx", line 407, in pandas.tslib.Timestamp.__new__ (pandas/tslib.c:10434)
    ts = convert_to_tsobject(ts_input, tz, unit, 0, 0)
  File "pandas/tslib.pyx", line 1542, in pandas.tslib.convert_to_tsobject (pandas/tslib.c:28780)
    raise TypeError('Cannot convert input to Timestamp')
TypeError: Cannot convert input to Timestamp
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/travis/miniconda/envs/pandas/lib/python3.6/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/home/travis/build/jreback/pandas/pandas/io/tests/test_pickle.py", line 239, in test_round_trip_current
    result = pd.read_pickle(path)
  File "/home/travis/build/jreback/pandas/pandas/io/pickle.py", line 68, in read_pickle
    return try_read(path, encoding='latin1')
  File "/home/travis/build/jreback/pandas/pandas/io/pickle.py", line 62, in try_read
    return pc.load(fh, encoding=encoding, compat=True)
  File "/home/travis/build/jreback/pandas/pandas/compat/pickle_compat.py", line 117, in load
    return up.load()
  File "/home/travis/miniconda/envs/pandas/lib/python3.6/pickle.py", line 1050, in load
    dispatch[key[0]](self)
  File "/home/travis/build/jreback/pandas/pandas/compat/pickle_compat.py", line 21, in load_reduce
    stack[-1] = func(*args)
  File "pandas/tslib.pyx", line 407, in pandas.tslib.Timestamp.__new__ (pandas/tslib.c:10434)
    ts = convert_to_tsobject(ts_input, tz, unit, 0, 0)
  File "pandas/tslib.pyx", line 1542, in pandas.tslib.convert_to_tsobject (pandas/tslib.c:28780)
    raise TypeError('Cannot convert input to Timestamp')
TypeError: Cannot convert input to Timestamp
======================================================================
ERROR: test_transactions (pandas.io.tests.test_sql.TestSQLiteFallback)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/jreback/pandas/pandas/io/sql.py", line 1401, in execute
    cur.execute(*args)
sqlite3.OperationalError: no such table: test_trans
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/travis/build/jreback/pandas/pandas/io/tests/test_sql.py", line 2004, in test_transactions
    self._transaction_test()
  File "/home/travis/build/jreback/pandas/pandas/io/tests/test_sql.py", line 476, in _transaction_test
    res = self.pandasSQL.read_query('SELECT * FROM test_trans')
  File "/home/travis/build/jreback/pandas/pandas/io/sql.py", line 1436, in read_query
    cursor = self.execute(*args)
  File "/home/travis/build/jreback/pandas/pandas/io/sql.py", line 1413, in execute
    raise_with_traceback(ex)
  File "/home/travis/build/jreback/pandas/pandas/compat/__init__.py", line 339, in raise_with_traceback
    raise exc.with_traceback(traceback)
  File "/home/travis/build/jreback/pandas/pandas/io/sql.py", line 1401, in execute
    cur.execute(*args)
pandas.io.sql.DatabaseError: Execution failed on sql 'SELECT * FROM test_trans': no such table: test_trans
======================================================================
ERROR: test_roundtrip_pickle (pandas.tseries.tests.test_offsets.TestCustomBusinessMonthBegin)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/jreback/pandas/pandas/tseries/tests/test_offsets.py", line 1980, in test_roundtrip_pickle
    _check_roundtrip(self._object())
  File "/home/travis/build/jreback/pandas/pandas/tseries/tests/test_offsets.py", line 1977, in _check_roundtrip
    unpickled = self.round_trip_pickle(obj)
  File "/home/travis/build/jreback/pandas/pandas/util/testing.py", line 96, in round_trip_pickle
    pd.to_pickle(obj, path)
  File "/home/travis/build/jreback/pandas/pandas/io/pickle.py", line 20, in to_pickle
    pkl.dump(obj, f, protocol=pkl.HIGHEST_PROTOCOL)
TypeError: can't pickle numpy.busdaycalendar objects
======================================================================
ERROR: test_roundtrip_pickle (pandas.tseries.tests.test_offsets.TestCustomBusinessMonthEnd)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/jreback/pandas/pandas/tseries/tests/test_offsets.py", line 1980, in test_roundtrip_pickle
    _check_roundtrip(self._object())
  File "/home/travis/build/jreback/pandas/pandas/tseries/tests/test_offsets.py", line 1977, in _check_roundtrip
    unpickled = self.round_trip_pickle(obj)
  File "/home/travis/build/jreback/pandas/pandas/util/testing.py", line 96, in round_trip_pickle
    pd.to_pickle(obj, path)
  File "/home/travis/build/jreback/pandas/pandas/io/pickle.py", line 20, in to_pickle
    pkl.dump(obj, f, protocol=pkl.HIGHEST_PROTOCOL)
TypeError: can't pickle numpy.busdaycalendar objects
======================================================================
ERROR: test_partial_slicing_with_multiindex (pandas.tseries.tests.test_timeseries.TestSlicing)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/jreback/pandas/pandas/tseries/tests/test_timeseries.py", line 4971, in test_partial_slicing_with_multiindex
    self.assertRaises(KeyError, f)
  File "/home/travis/build/jreback/pandas/pandas/util/testing.py", line 2380, in assertRaises
    _callable(*args, **kwargs)
  File "/home/travis/build/jreback/pandas/pandas/tseries/tests/test_timeseries.py", line 4969, in f
    df_multi.loc[('2013-06-19', 'ACCT1', 'ABC')]
  File "/home/travis/build/jreback/pandas/pandas/core/indexing.py", line 1309, in __getitem__
    return self._getitem_tuple(key)
  File "/home/travis/build/jreback/pandas/pandas/core/indexing.py", line 800, in _getitem_tuple
    self._has_valid_tuple(tup)
  File "/home/travis/build/jreback/pandas/pandas/core/indexing.py", line 150, in _has_valid_tuple
    if not self._has_valid_type(k, i):
  File "/home/travis/build/jreback/pandas/pandas/core/indexing.py", line 1409, in _has_valid_type
    if key not in ax:
  File "/home/travis/build/jreback/pandas/pandas/indexes/multi.py", line 1042, in __contains__
    self.get_loc(key)
  File "/home/travis/build/jreback/pandas/pandas/indexes/multi.py", line 1643, in get_loc
    loc = self._get_level_indexer(key, level=0)
  File "/home/travis/build/jreback/pandas/pandas/indexes/multi.py", line 1917, in _get_level_indexer
    i = labels.searchsorted(loc, side='left')
TypeError: '>' not supported between instances of 'int' and 'slice'
======================================================================
ERROR: test_pickle (pandas.tseries.tests.test_timeseries.TestTimeSeries)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/jreback/pandas/pandas/io/pickle.py", line 52, in try_read
    return pkl.load(fh)
TypeError: __new__() takes exactly one argument (2 given)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/travis/build/jreback/pandas/pandas/io/pickle.py", line 57, in try_read
    return pc.load(fh, encoding=encoding, compat=False)
  File "/home/travis/build/jreback/pandas/pandas/compat/pickle_compat.py", line 117, in load
    return up.load()
  File "/home/travis/miniconda/envs/pandas/lib/python3.6/pickle.py", line 1050, in load
    dispatch[key[0]](self)
  File "/home/travis/build/jreback/pandas/pandas/compat/pickle_compat.py", line 21, in load_reduce
    stack[-1] = func(*args)
TypeError: __new__() takes exactly one argument (2 given)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/travis/build/jreback/pandas/pandas/io/pickle.py", line 65, in read_pickle
    return try_read(path)
  File "/home/travis/build/jreback/pandas/pandas/io/pickle.py", line 62, in try_read
    return pc.load(fh, encoding=encoding, compat=True)
  File "/home/travis/build/jreback/pandas/pandas/compat/pickle_compat.py", line 117, in load
    return up.load()
  File "/home/travis/miniconda/envs/pandas/lib/python3.6/pickle.py", line 1050, in load
    dispatch[key[0]](self)
  File "/home/travis/build/jreback/pandas/pandas/compat/pickle_compat.py", line 21, in load_reduce
    stack[-1] = func(*args)
TypeError: __new__() takes exactly one argument (2 given)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/travis/build/jreback/pandas/pandas/io/pickle.py", line 52, in try_read
    return pkl.load(fh)
TypeError: __new__() takes exactly one argument (2 given)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/travis/build/jreback/pandas/pandas/io/pickle.py", line 57, in try_read
    return pc.load(fh, encoding=encoding, compat=False)
  File "/home/travis/build/jreback/pandas/pandas/compat/pickle_compat.py", line 117, in load
    return up.load()
  File "/home/travis/miniconda/envs/pandas/lib/python3.6/pickle.py", line 1050, in load
    dispatch[key[0]](self)
  File "/home/travis/build/jreback/pandas/pandas/compat/pickle_compat.py", line 21, in load_reduce
    stack[-1] = func(*args)
TypeError: __new__() takes exactly one argument (2 given)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/travis/build/jreback/pandas/pandas/tseries/tests/test_timeseries.py", line 2219, in test_pickle
    p = self.round_trip_pickle(NaT)
  File "/home/travis/build/jreback/pandas/pandas/util/testing.py", line 97, in round_trip_pickle
    return pd.read_pickle(path)
  File "/home/travis/build/jreback/pandas/pandas/io/pickle.py", line 68, in read_pickle
    return try_read(path, encoding='latin1')
  File "/home/travis/build/jreback/pandas/pandas/io/pickle.py", line 62, in try_read
    return pc.load(fh, encoding=encoding, compat=True)
  File "/home/travis/build/jreback/pandas/pandas/compat/pickle_compat.py", line 117, in load
    return up.load()
  File "/home/travis/miniconda/envs/pandas/lib/python3.6/pickle.py", line 1050, in load
    dispatch[key[0]](self)
  File "/home/travis/build/jreback/pandas/pandas/compat/pickle_compat.py", line 21, in load_reduce
    stack[-1] = func(*args)
TypeError: __new__() takes exactly one argument (2 given)
======================================================================
ERROR: Test case for when the object being moved has exactly one reference.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/jreback/pandas/pandas/tests/test_util.py", line 326, in test_exactly_one_ref
    as_stolen_buf = move_into_mutable_buffer(b[:-3])
pandas.util._move.BadMove: b'test'
======================================================================
FAIL: test_argsort (pandas.tests.indexes.test_base.TestMixedIntIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/jreback/pandas/pandas/tests/indexes/test_base.py", line 1789, in test_argsort
    result = idx.argsort()
  File "/home/travis/build/jreback/pandas/pandas/indexes/base.py", line 1784, in argsort
    return result.argsort(*args, **kwargs)
TypeError: '>' not supported between instances of 'str' and 'int'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/travis/build/jreback/pandas/pandas/tests/indexes/test_base.py", line 1789, in test_argsort
    result = idx.argsort()
  File "/home/travis/build/jreback/pandas/pandas/util/testing.py", line 2452, in __exit__
    return self.handle_success(exc_type, exc_value, traceback)
  File "/home/travis/build/jreback/pandas/pandas/util/testing.py", line 2465, in handle_success
    raise_with_traceback(e, traceback)
  File "/home/travis/build/jreback/pandas/pandas/compat/__init__.py", line 339, in raise_with_traceback
    raise exc.with_traceback(traceback)
  File "/home/travis/build/jreback/pandas/pandas/tests/indexes/test_base.py", line 1789, in test_argsort
    result = idx.argsort()
  File "/home/travis/build/jreback/pandas/pandas/indexes/base.py", line 1784, in argsort
    return result.argsort(*args, **kwargs)
AssertionError: "unorderable types" does not match "'>' not supported between instances of 'str' and 'int'"
======================================================================
FAIL: test_numpy_argsort (pandas.tests.indexes.test_base.TestMixedIntIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/jreback/pandas/pandas/tests/indexes/test_base.py", line 1799, in test_numpy_argsort
    result = np.argsort(idx)
  File "/home/travis/miniconda/envs/pandas/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 913, in argsort
    return argsort(axis, kind, order)
  File "/home/travis/build/jreback/pandas/pandas/indexes/base.py", line 1784, in argsort
    return result.argsort(*args, **kwargs)
TypeError: '>' not supported between instances of 'str' and 'int'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/travis/build/jreback/pandas/pandas/tests/indexes/test_base.py", line 1799, in test_numpy_argsort
    result = np.argsort(idx)
  File "/home/travis/build/jreback/pandas/pandas/util/testing.py", line 2452, in __exit__
    return self.handle_success(exc_type, exc_value, traceback)
  File "/home/travis/build/jreback/pandas/pandas/util/testing.py", line 2465, in handle_success
    raise_with_traceback(e, traceback)
  File "/home/travis/build/jreback/pandas/pandas/compat/__init__.py", line 339, in raise_with_traceback
    raise exc.with_traceback(traceback)
  File "/home/travis/build/jreback/pandas/pandas/tests/indexes/test_base.py", line 1799, in test_numpy_argsort
    result = np.argsort(idx)
  File "/home/travis/miniconda/envs/pandas/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 913, in argsort
    return argsort(axis, kind, order)
  File "/home/travis/build/jreback/pandas/pandas/indexes/base.py", line 1784, in argsort
    return result.argsort(*args, **kwargs)
AssertionError: "unorderable types" does not match "'>' not supported between instances of 'str' and 'int'"
======================================================================
FAIL: test_order (pandas.tests.indexes.test_base.TestMixedIntIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/jreback/pandas/pandas/tests/indexes/test_base.py", line 1780, in test_order
    idx.order()
  File "/home/travis/build/jreback/pandas/pandas/indexes/base.py", line 1730, in order
    ascending=ascending)
  File "/home/travis/build/jreback/pandas/pandas/indexes/base.py", line 1710, in sort_values
    _as = self.argsort()
  File "/home/travis/build/jreback/pandas/pandas/indexes/base.py", line 1784, in argsort
    return result.argsort(*args, **kwargs)
TypeError: '>' not supported between instances of 'str' and 'int'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/travis/build/jreback/pandas/pandas/tests/indexes/test_base.py", line 1780, in test_order
    idx.order()
  File "/home/travis/build/jreback/pandas/pandas/util/testing.py", line 2452, in __exit__
    return self.handle_success(exc_type, exc_value, traceback)
  File "/home/travis/build/jreback/pandas/pandas/util/testing.py", line 2465, in handle_success
    raise_with_traceback(e, traceback)
  File "/home/travis/build/jreback/pandas/pandas/compat/__init__.py", line 339, in raise_with_traceback
    raise exc.with_traceback(traceback)
  File "/home/travis/build/jreback/pandas/pandas/tests/indexes/test_base.py", line 1780, in test_order
    idx.order()
  File "/home/travis/build/jreback/pandas/pandas/indexes/base.py", line 1730, in order
    ascending=ascending)
  File "/home/travis/build/jreback/pandas/pandas/indexes/base.py", line 1710, in sort_values
    _as = self.argsort()
  File "/home/travis/build/jreback/pandas/pandas/indexes/base.py", line 1784, in argsort
    return result.argsort(*args, **kwargs)
AssertionError: "unorderable types" does not match "'>' not supported between instances of 'str' and 'int'"
======================================================================
FAIL: test_basic_indexing (pandas.tests.series.test_indexing.TestSeriesIndexing)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/jreback/pandas/pandas/tests/series/test_indexing.py", line 1356, in test_basic_indexing
    self.assertRaises(IndexError, s.__setitem__, 5, 0)
  File "/home/travis/build/jreback/pandas/pandas/util/testing.py", line 2380, in assertRaises
    _callable(*args, **kwargs)
  File "/home/travis/build/jreback/pandas/pandas/util/testing.py", line 2450, in __exit__
    raise AssertionError("{0} not raised.".format(name))
AssertionError: IndexError not raised.
----------------------------------------------------------------------
Ran 10330 tests in 439.233s
FAILED (SKIP=724, errors=7, failures=4)
@jreback jreback added Compat pandas objects compatability with Numpy or Python functions Python 3.5 labels Nov 17, 2016
@jreback jreback added this to the 0.19.2 milestone Nov 17, 2016
jreback added a commit to jreback/pandas that referenced this issue Nov 17, 2016
jreback added a commit to jreback/pandas that referenced this issue Nov 17, 2016
jreback added a commit that referenced this issue Nov 18, 2016
partial on #14679

Author: Jeff Reback <[email protected]>

Closes #14681 from jreback/warnings and squashes the following commits:

56e7b1b [Jeff Reback] COMPAT: remove some deprecation warnings in 3.6
@jreback
Copy link
Contributor Author

jreback commented Nov 18, 2016

some of these pickle issues are due to an apparent change in how the pickle methods, specifically __reduce__ are called. Here is a bug report. http://bugs.python.org/issue28730

jreback added a commit to jreback/pandas that referenced this issue Nov 18, 2016
jreback added a commit to jreback/pandas that referenced this issue Nov 18, 2016
jreback added a commit to jreback/pandas that referenced this issue Nov 18, 2016
jreback added a commit to jreback/pandas that referenced this issue Nov 18, 2016
@jreback
Copy link
Contributor Author

jreback commented Nov 18, 2016

cc @llllllllll

======================================================================
ERROR: Test case for when the object being moved has exactly one reference.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/jreback/pandas/pandas/tests/test_util.py", line 326, in test_exactly_one_ref
    as_stolen_buf = move_into_mutable_buffer(b[:-3])
pandas.util._move.BadMove: b'test'

@llllllllll
Copy link
Contributor

I will look into this tomorrow.

jreback added a commit that referenced this issue Nov 18, 2016
xref #14679

Author: Jeff Reback <[email protected]>

Closes #14685 from jreback/offsets and squashes the following commits:

8ad212c [Jeff Reback] BUG: fix pickling of Custom offsets in 3.6
jreback added a commit that referenced this issue Nov 18, 2016
TST: fix unordable error message

xref #14679

TST: handle unorderable exceptions in indexing

closes #14684
@jreback
Copy link
Contributor Author

jreback commented Nov 18, 2016

@jorisvandenbossche not sure why this fails on 3.6

======================================================================
ERROR: test_transactions (pandas.io.tests.test_sql.TestSQLiteFallback)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/jreback/pandas/pandas/io/sql.py", line 1401, in execute
    cur.execute(*args)
sqlite3.OperationalError: no such table: test_trans
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/travis/build/jreback/pandas/pandas/io/tests/test_sql.py", line 2004, in test_transactions
    self._transaction_test()
  File "/home/travis/build/jreback/pandas/pandas/io/tests/test_sql.py", line 476, in _transaction_test
    res = self.pandasSQL.read_query('SELECT * FROM test_trans')
  File "/home/travis/build/jreback/pandas/pandas/io/sql.py", line 1436, in read_query
    cursor = self.execute(*args)
  File "/home/travis/build/jreback/pandas/pandas/io/sql.py", line 1413, in execute
    raise_with_traceback(ex)
  File "/home/travis/build/jreback/pandas/pandas/compat/__init__.py", line 339, in raise_with_traceback
    raise exc.with_traceback(traceback)
  File "/home/travis/build/jreback/pandas/pandas/io/sql.py", line 1401, in execute
    cur.execute(*args)
pandas.io.sql.DatabaseError: Execution failed on sql 'SELECT * FROM test_trans': no such table: test_trans

@jreback
Copy link
Contributor Author

jreback commented Nov 18, 2016

@jorisvandenbossche
Copy link
Member

@jreback regarding sql error: not directly an idea. I can reproduce it by running the specific test, but not with a standalone snippet:

import sqlite3
import pandas as pd

con = sqlite3.connect(':memory:')

db = pd.io.sql.SQLiteDatabase(con)
db.execute("CREATE TABLE test_trans (A INT, B TEXT)")

try:
    with db.run_transaction() as cur:
        cur.execute("INSERT INTO test_trans (A,B) VALUES (1, 'blah')")
        raise Exception()
except:
    pass

db.read_query('SELECT * FROM test_trans')

runs fine

jreback pushed a commit that referenced this issue Nov 22, 2016
In python 3.6, the CALL_FUNCTION handling was updated. One change is
that when calling a C function from a python function python now
counts  the reference owned by the argument tuple. This means that
move was  always seeing objects with two references instead of the
expected  one.    Python 3.6 also removed a copy in the argument tuple
when *unpacking  functions. This means that if a user does:    tuple =
(create_string(),)  move_into_mutable_buffer(*tuple)    where
create_string() creates a string object with one reference then we
will fail to raise a BadMove even though the user could later retrieve
that string with tuple[0]. There is no way to detect this case so this
patch adds a warning to the docstring advising against star unpacking.
xref: #14679    I played around with removing the extra reference that
was added in 3.6 but it looks like playing with borrowed refs
everywhere will be a bit tricky. This change should clear things up
for 3.6 while continuing to work for older versions. In 3.6 you
__could__ get a shared mutable string from this but you need to try
pretty hard for it.

Author: Joe Jevnik <[email protected]>

Closes #14695 from llllllllll/move-3.6-compat and squashes the following commits:

d1e8b1b [Joe Jevnik] BUG: Fix move_into_mutable_buffer for python 3.6.
@jorisvandenbossche
Copy link
Member

Jeff, apart from the sql problem for which I opened another issue, are all of the above errors solved in the meantime? Or are there still ones to look at?

@jreback
Copy link
Contributor Author

jreback commented Nov 25, 2016

nope that's it

@jreback jreback closed this as completed Nov 25, 2016
jorisvandenbossche pushed a commit to jorisvandenbossche/pandas that referenced this issue Dec 14, 2016
partial on pandas-dev#14679

Author: Jeff Reback <[email protected]>

Closes pandas-dev#14681 from jreback/warnings and squashes the following commits:

56e7b1b [Jeff Reback] COMPAT: remove some deprecation warnings in 3.6

(cherry picked from commit 748000d)

Fixed conflicts in:
	pandas/io/tests/test_clipboard.py
jorisvandenbossche pushed a commit to jorisvandenbossche/pandas that referenced this issue Dec 14, 2016
xref pandas-dev#14679

Author: Jeff Reback <[email protected]>

Closes pandas-dev#14685 from jreback/offsets and squashes the following commits:

8ad212c [Jeff Reback] BUG: fix pickling of Custom offsets in 3.6

(cherry picked from commit bec5bdb)
jorisvandenbossche pushed a commit to jorisvandenbossche/pandas that referenced this issue Dec 14, 2016
…Timestamp input

TST: fix unordable error message

xref pandas-dev#14679

TST: handle unorderable exceptions in indexing

closes pandas-dev#14684

(cherry picked from commit b6ffd89)
jorisvandenbossche pushed a commit to jorisvandenbossche/pandas that referenced this issue Dec 14, 2016
…hon 3.6.

In python 3.6, the CALL_FUNCTION handling was updated. One change is
that when calling a C function from a python function python now
counts  the reference owned by the argument tuple. This means that
move was  always seeing objects with two references instead of the
expected  one.    Python 3.6 also removed a copy in the argument tuple
when *unpacking  functions. This means that if a user does:    tuple =
(create_string(),)  move_into_mutable_buffer(*tuple)    where
create_string() creates a string object with one reference then we
will fail to raise a BadMove even though the user could later retrieve
that string with tuple[0]. There is no way to detect this case so this
patch adds a warning to the docstring advising against star unpacking.
xref: pandas-dev#14679    I played around with removing the extra reference that
was added in 3.6 but it looks like playing with borrowed refs
everywhere will be a bit tricky. This change should clear things up
for 3.6 while continuing to work for older versions. In 3.6 you
__could__ get a shared mutable string from this but you need to try
pretty hard for it.

Author: Joe Jevnik <[email protected]>

Closes pandas-dev#14695 from llllllllll/move-3.6-compat and squashes the following commits:

d1e8b1b [Joe Jevnik] BUG: Fix move_into_mutable_buffer for python 3.6.

(cherry picked from commit f609640)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions
Projects
None yet
Development

No branches or pull requests

3 participants