Skip to content
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

CI Failures for test_string_na_nat_conversion #26200

Closed
WillAyd opened this issue Apr 23, 2019 · 2 comments
Closed

CI Failures for test_string_na_nat_conversion #26200

WillAyd opened this issue Apr 23, 2019 · 2 comments
Labels
CI Continuous Integration

Comments

@WillAyd
Copy link
Member

WillAyd commented Apr 23, 2019

These just started showing up in the build today:

___________ TestToDatetimeMisc.test_string_na_nat_conversion[False] ____________
[gw0] linux -- Python 3.7.3 /home/vsts/miniconda3/envs/pandas-dev/bin/python

self = <pandas.tests.indexes.datetimes.test_tools.TestToDatetimeMisc object at 0x7f38c92b73c8>
cache = False

    @pytest.mark.parametrize('cache', [True, False])
    def test_string_na_nat_conversion(self, cache):
        # GH #999, #858
    
        strings = np.array(['1/1/2000', '1/2/2000', np.nan,
                            '1/4/2000, 12:34:56'], dtype=object)
    
        expected = np.empty(4, dtype='M8[ns]')
        for i, val in enumerate(strings):
            if isna(val):
                expected[i] = iNaT
            else:
                expected[i] = parse(val)
    
        result = tslib.array_to_datetime(strings)[0]
        tm.assert_almost_equal(result, expected)
    
        result2 = to_datetime(strings, cache=cache)
        assert isinstance(result2, DatetimeIndex)
        tm.assert_numpy_array_equal(result, result2.values)
    
        malformed = np.array(['1/100/2000', np.nan], dtype=object)
    
        # GH 10636, default is now 'raise'
        msg = (r"\(u?'Unknown string format:', '1/100/2000'\)|"
               "day is out of range for month")
        with pytest.raises(ValueError, match=msg):
>           to_datetime(malformed, errors='raise', cache=cache)
E           AssertionError: Pattern '\(u?'Unknown string format:', '1/100/2000'\)|day is out of range for month' not found in 'Unknown string format: 1/100/2000'

Not sure what the root cause is. I figured should be good enough to relax the error message for the time being and not block CI for others.

@simonjayhawkins looks like you might have changed this test to add a more restrictive message so if you want to dive into further detail for a more comprehensive fix would certainly be welcome

@WillAyd WillAyd added the CI Continuous Integration label Apr 23, 2019
@WillAyd WillAyd changed the title CI Failures CI Failures for test_string_na_nat_conversion Apr 23, 2019
@simonjayhawkins
Copy link
Member

Not sure what the root cause is

xref dateutil/dateutil#881

bugfix on dateutil master that includes formatting the error message correctly instead of displaying a tuple.

I figured should be good enough to relax the error message for the time being and not block CI for others.

no problem. there are four tests that hit this message; the other 3 aren't affected by this change.

@WillAyd
Copy link
Member Author

WillAyd commented Apr 24, 2019

Closed via #26201

@WillAyd WillAyd closed this as completed Apr 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration
Projects
None yet
Development

No branches or pull requests

2 participants