Skip to content

Equality comparison raises exception #7830

Closed
@dhirschfeld

Description

@dhirschfeld

Test case:

def test_datetimeindex__eq__():
    """Equality comparisons should never raise an exception"""
    pd.DatetimeIndex(['01-Jan-2015']) == ()
In [115]: test_datetimeindex__eq__()
Traceback (most recent call last):

  File "<ipython-input-115-9b7967ca9de2>", line 1, in <module>
    test_datetimeindex__eq__()

  File "<ipython-input-114-7ae5783187b8>", line 3, in test_datetimeindex__eq__
    pd.DatetimeIndex(['01-Jan-2015']) == ()

  File "C:\dev\bin\Anaconda\lib\site-packages\pandas\tseries\index.py", line 90, in wrapper
    other = _ensure_datetime64(other)

  File "C:\dev\bin\Anaconda\lib\site-packages\pandas\tseries\index.py", line 112, in _ensure_datetime64
    raise TypeError('%s type object %s' % (type(other), str(other)))

TypeError: <type 'tuple'> type object ()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Error ReportingIncorrect or improved errors from pandas

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions