Skip to content

TEST: failing test pandas.tseries.tests.test_frequencies.TestFrequencyInference #11287

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
FRidh opened this issue Oct 11, 2015 · 1 comment
Closed
Labels
Testing pandas testing functions or related to the test suite Unicode Unicode strings
Milestone

Comments

@FRidh
Copy link

FRidh commented Oct 11, 2015

While packaging pandas 0.17 for Nix, I noticed this test to fail. I've tested with both Python 2.7 and 3.4.

test_invalid_index_types (pandas.tseries.tests.test_frequencies.TestFrequencyInference) ... ERROR

======================================================================
ERROR: test_invalid_index_types (pandas.tseries.tests.test_frequencies.TestFrequencyInference)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/nix-build-python2.7-pandas-0.17.0.drv-0/pandas-0.17.0/pandas/tseries/tests/test_frequencies.py", line 565, in test_invalid_index_types
    self.assertRaises(ValueError, lambda : frequencies.infer_freq(i))
  File "/tmp/nix-build-python2.7-pandas-0.17.0.drv-0/pandas-0.17.0/pandas/util/testing.py", line 1879, in assertRaises
    _callable(*args, **kwargs)
  File "/tmp/nix-build-python2.7-pandas-0.17.0.drv-0/pandas-0.17.0/pandas/tseries/tests/test_frequencies.py", line 565, in <lambda>
    self.assertRaises(ValueError, lambda : frequencies.infer_freq(i))
  File "/tmp/nix-build-python2.7-pandas-0.17.0.drv-0/pandas-0.17.0/pandas/tseries/frequencies.py", line 855, in infer_freq
    index = pd.DatetimeIndex(index)
  File "/tmp/nix-build-python2.7-pandas-0.17.0.drv-0/pandas-0.17.0/pandas/util/decorators.py", line 89, in wrapper
    return func(*args, **kwargs)
  File "/tmp/nix-build-python2.7-pandas-0.17.0.drv-0/pandas-0.17.0/pandas/tseries/index.py", line 315, in __new__
    subarr = tools.to_datetime(data, box=False)
  File "/tmp/nix-build-python2.7-pandas-0.17.0.drv-0/pandas-0.17.0/pandas/util/decorators.py", line 89, in wrapper
    return func(*args, **kwargs)
  File "/tmp/nix-build-python2.7-pandas-0.17.0.drv-0/pandas-0.17.0/pandas/tseries/tools.py", line 276, in to_datetime
    unit=unit, infer_datetime_format=infer_datetime_format)
  File "/tmp/nix-build-python2.7-pandas-0.17.0.drv-0/pandas-0.17.0/pandas/tseries/tools.py", line 395, in _to_datetime
    return _convert_listlike(arg, box, format)
  File "/tmp/nix-build-python2.7-pandas-0.17.0.drv-0/pandas-0.17.0/pandas/tseries/tools.py", line 372, in _convert_listlike
    require_iso8601=require_iso8601)
  File "pandas/tslib.pyx", line 1828, in pandas.tslib.array_to_datetime (pandas/tslib.c:36848)
    cpdef array_to_datetime(ndarray[object] values, errors='raise',
  File "pandas/tslib.pyx", line 2017, in pandas.tslib.array_to_datetime (pandas/tslib.c:36443)
    raise
  File "pandas/tslib.pyx", line 2011, in pandas.tslib.array_to_datetime (pandas/tslib.c:36333)
    oresult[i] = parse_datetime_string(val, dayfirst=dayfirst,
  File "pandas/tslib.pyx", line 1602, in pandas.tslib.parse_datetime_string (pandas/tslib.c:29166)
    dt = parse_date(date_string, default=_DEFAULT_DATETIME,
  File "/nix/store/cc5vqjhmxwnm5f0jwixyi0g643y3iv4f-python2.7-dateutil-2.2/lib/python2.7/site-packages/dateutil/parser.py", line 748, in parse
    return DEFAULTPARSER.parse(timestr, **kwargs)
  File "/nix/store/cc5vqjhmxwnm5f0jwixyi0g643y3iv4f-python2.7-dateutil-2.2/lib/python2.7/site-packages/dateutil/parser.py", line 310, in parse
    res, skipped_tokens = self._parse(timestr, **kwargs)
TypeError: 'NoneType' object is not iterable

Since Travis does not seem to be failing I could imagine this is a Nix issue. If so, do you have any suggestion regarding dependencies of software this specific piece of code that is tested needs?

@jreback
Copy link
Contributor

jreback commented Oct 11, 2015

this is the same issue I noted here: #10822

it fails on windows (so is skipped), but cannot repro on travis/macosx. Its supposed to fail parsing and a raise a ValueError instead in raises a TypeError; note that this is actually hits dateutil. If you'd like to dig in and see where it is failing then we can modify the test.

@jreback jreback added Testing pandas testing functions or related to the test suite Unicode Unicode strings labels Oct 11, 2015
@sinhrks sinhrks added this to the 0.19.0 milestone Jul 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite Unicode Unicode strings
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants