We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 700fa38 commit f8159c2Copy full SHA for f8159c2
pandas/tests/indexes/datetimes/test_tools.py
@@ -467,6 +467,22 @@ def test_datetime_bool(self, cache):
467
NaT,
468
to_datetime(0, cache=cache)]))
469
470
+ def test_datetime_require_iso8601(self):
471
+ # GH19671
472
+ s = Series(['M1809', 'M1701', Timestamp('20130101')])
473
+ with pytest.raises(ValueError):
474
+ to_datetime(s, require_iso8601=True, errors='raise')
475
+ tm.assert_series_equal(
476
+ to_datetime(s, require_iso8601=True, errors='ignore'),
477
+ Series(['M1809', 'M1701', Timestamp('20130101')]))
478
479
+ to_datetime(s, require_iso8601=True, errors='coerce'),
480
+ Series([NaT, NaT, Timestamp('20130101')]))
481
482
+ to_datetime(s, require_iso8601=False, errors='raise'),
483
+ Series([Timestamp('18090101'), Timestamp('17010101'),
484
+ Timestamp('20130101')]))
485
+
486
def test_datetime_invalid_datatype(self):
487
# GH13176
488
0 commit comments