Skip to content

Python 2.7 travis build failing #8579

Closed

Description

@dstansby

The python 2.7 build on travis is currently failing with (https://travis-ci.org/matplotlib/matplotlib/jobs/229149439(

=================================== FAILURES ===================================

__________________________ test_pandas_indexing_dates __________________________

[gw0] linux2 -- Python 2.7.9 /home/travis/build/matplotlib/matplotlib/venv/bin/python

def test_pandas_indexing_dates():

>       pd = pytest.importorskip('pandas')

lib/matplotlib/tests/test_axes.py:4835: 

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

venv/lib/python2.7/site-packages/pandas/__init__.py:26: in <module>

    from pandas._libs import (hashtable as _hashtable,

venv/lib/python2.7/site-packages/pandas/_libs/__init__.py:3: in <module>

    from .tslib import iNaT, NaT, Timestamp, Timedelta, OutOfBoundsDatetime

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???

E   ValueError: numpy.dtype has the wrong size, try recompiling. Expected 88, got 96

pandas/_libs/src/numpy.pxd:157: ValueError

!!!!!!!!!!!!!!!!!!!! Interrupted: stopping after 1 failures !!!!!!!!!!!!!!!!!!!!

============== 1 failed, 485 passed, 4 skipped in 179.12 seconds ===============

Activity

  1. matthew-brett commented on May 5, 2017

    @matthew-brett
    Contributor

    I am not sure what's going on - but I see that Pandas just released version 0.20 without (yet) uploading Linux wheels, so the testing is running a source install of Pandas when it usually runs a binary (wheel) install: pandas-dev/pandas#16260

  2. dstansby commented on May 6, 2017

    @dstansby
    MemberAuthor

    Hmm, still failing and it looks like the build is using a pandas 0.20.1 wheel: https://travis-ci.org/matplotlib/matplotlib/jobs/229296183#L885 , but a different error now:

    =================================== FAILURES ===================================
    
    ___________________________ test_date2num_dst_pandas ___________________________
    
    [gw1] linux2 -- Python 2.7.9 /home/travis/build/matplotlib/matplotlib/venv/bin/python
    
    def test_date2num_dst_pandas():
    
            # Test for github issue #3896, but in date2num around DST transitions
    
            # with a timezone-aware pandas date_range object.
    
            pd = pytest.importorskip('pandas')
    
        
    
            def tz_convert(*args):
    
                return pd.DatetimeIndex.tz_convert(*args).astype(datetime.datetime)
    
        
    
    >       _test_date2num_dst(pd.date_range, tz_convert)
    
    lib/matplotlib/tests/test_dates.py:442: 
    
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    lib/matplotlib/tests/test_dates.py:362: in _test_date2num_dst
    
        dt_bxl = tz_convert(dt_utc, BRUSSELS)
    
    lib/matplotlib/tests/test_dates.py:440: in tz_convert
    
        return pd.DatetimeIndex.tz_convert(*args).astype(datetime.datetime)
    
    venv/lib/python2.7/site-packages/pandas/core/indexes/datetimes.py:848: in astype
    
        dtype = pandas_dtype(dtype)
    
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    dtype = <type 'datetime.datetime'>
    
        def pandas_dtype(dtype):
    
            """
    
            Converts input into a pandas only dtype object or a numpy dtype object.
    
        
    
            Parameters
    
            ----------
    
            dtype : object to be converted
    
        
    
            Returns
    
            -------
    
            np.dtype or a pandas dtype
    
            """
    
        
    
            if isinstance(dtype, DatetimeTZDtype):
    
                return dtype
    
            elif isinstance(dtype, PeriodDtype):
    
                return dtype
    
            elif isinstance(dtype, CategoricalDtype):
    
                return dtype
    
            elif isinstance(dtype, IntervalDtype):
    
                return dtype
    
            elif isinstance(dtype, string_types):
    
                try:
    
                    return DatetimeTZDtype.construct_from_string(dtype)
    
                except TypeError:
    
                    pass
    
        
    
                if dtype.startswith('period[') or dtype.startswith('Period['):
    
                    # do not parse string like U as period[U]
    
                    try:
    
                        return PeriodDtype.construct_from_string(dtype)
    
                    except TypeError:
    
                        pass
    
        
    
                elif dtype.startswith('interval[') or dtype.startswith('Interval['):
    
                    try:
    
                        return IntervalDtype.construct_from_string(dtype)
    
                    except TypeError:
    
                        pass
    
        
    
                try:
    
                    return CategoricalDtype.construct_from_string(dtype)
    
                except TypeError:
    
                    pass
    
            elif isinstance(dtype, ExtensionDtype):
    
                return dtype
    
        
    
            try:
    
                npdtype = np.dtype(dtype)
    
            except (TypeError, ValueError):
    
                raise
    
        
    
            # Any invalid dtype (such as pd.Timestamp) should raise an error.
    
            # np.dtype(invalid_type).kind = 0 for such objects. However, this will
    
            # also catch some valid dtypes such as object, np.object_ and 'object'
    
            # which we safeguard against by catching them earlier and returning
    
            # np.dtype(valid_dtype) before this condition is evaluated.
    
            if dtype in [object, np.object_, 'object', 'O']:
    
                return npdtype
    
            elif npdtype.kind == 'O':
    
    >           raise TypeError('dtype {0} not understood'.format(dtype))
    
    E           TypeError: dtype <type 'datetime.datetime'> not understood
    
    venv/lib/python2.7/site-packages/pandas/core/dtypes/common.py:1909: TypeError
    
    !!!!!!!!!!!!!!!!!!!! Interrupted: stopping after 1 failures !!!!!!!!!!!!!!!!!!!!
    
  3. QuLogic commented on May 6, 2017

    @QuLogic
    Member

    Might be related to this change which used to pass through any NumPy object dtype (which np.dtype(datetime) is), but now only allows it if the original Pandas dtype was also object.

  4. jorisvandenbossche commented on May 6, 2017

    @jorisvandenbossche

    As I also answered on the pandas issue, you can easily fix the test by removing the astype(datetime.datetime).
    I think removing it will work just fine, otherwise to have exactly the same you can replace with .astype(object) or .to_pydatetime() (although you might actually want to test with pd.Timestamps, not with datetime.datetime objects, depending on the purpose of the test)

  5. modified the milestones: , , on May 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions