Smarter formatting of timedelta and datetime columns by cancan101 · Pull Request #5701 · pandas-dev/pandas (original) (raw)

I think that this commit broke some tests: cancan101@cfb9c98

(pandas-dev) ~/E/p/l/p/s/p/p/tests ((cfb9c98...)) nosetests test_index
...........................EE.E...................................................................................................................................................
======================================================================
ERROR: test_format (test_index.TestIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/tests/test_index.py", line 488, in test_format
    self._check_method_works(Index.format)
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/tests/test_index.py", line 540, in _check_method_works
    method(self.dateIndex)
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/core/index.py", line 703, in format
    return self._format_with_header(header, **kwargs)
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/tseries/index.py", line 639, in _format_with_header
    return header + self._format_native_types(**kwargs)
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/tseries/index.py", line 648, in _format_native_types
    justify='all').get_result()
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/core/format.py", line 1635, in get_result
    fmt_values = self._format_strings()
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/core/format.py", line 1760, in _format_strings
    date_format=self.date_format)
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/core/format.py", line 1813, in _get_format_datetime64_from_values
    is_dates_only = _is_dates_only(values)
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/core/format.py", line 1795, in _is_dates_only
    if d is not None and not lib.checknull(d) and d._has_time_component():
AttributeError: 'Timestamp' object has no attribute '_has_time_component'

======================================================================
ERROR: test_format_datetime_with_time (test_index.TestIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/tests/test_index.py", line 520, in test_format_datetime_with_time
    result = t.format()
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/core/index.py", line 703, in format
    return self._format_with_header(header, **kwargs)
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/tseries/index.py", line 639, in _format_with_header
    return header + self._format_native_types(**kwargs)
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/tseries/index.py", line 648, in _format_native_types
    justify='all').get_result()
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/core/format.py", line 1635, in get_result
    fmt_values = self._format_strings()
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/core/format.py", line 1760, in _format_strings
    date_format=self.date_format)
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/core/format.py", line 1813, in _get_format_datetime64_from_values
    is_dates_only = _is_dates_only(values)
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/core/format.py", line 1795, in _is_dates_only
    if d is not None and not lib.checknull(d) and d._has_time_component():
AttributeError: 'Timestamp' object has no attribute '_has_time_component'

======================================================================
ERROR: test_format_with_name_time_info (test_index.TestIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/tests/test_index.py", line 514, in test_format_with_name_time_info
    formatted = dates.format(name=True)
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/core/index.py", line 703, in format
    return self._format_with_header(header, **kwargs)
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/tseries/index.py", line 639, in _format_with_header
    return header + self._format_native_types(**kwargs)
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/tseries/index.py", line 648, in _format_native_types
    justify='all').get_result()
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/core/format.py", line 1635, in get_result
    fmt_values = self._format_strings()
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/core/format.py", line 1760, in _format_strings
    date_format=self.date_format)
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/core/format.py", line 1813, in _get_format_datetime64_from_values
    is_dates_only = _is_dates_only(values)
  File "/Users/admin/Envs/pandas-dev/lib/python2.7/site-packages/pandas/pandas/core/format.py", line 1795, in _is_dates_only
    if d is not None and not lib.checknull(d) and d._has_time_component():
AttributeError: 'Timestamp' object has no attribute '_has_time_component'

----------------------------------------------------------------------
Ran 178 tests in 1.166s

FAILED (errors=3)

I'm on a Mac if that matters. I can do a bit of digging.