Skip to content

Commit cfc93ad

Browse files
MarcoGorellipmhatre1
authored andcommitted
CI: avoid guess_datetime_format failure on 29th of Feburary (pandas-dev#57674)
* try fix ci * add comment
1 parent fabc72f commit cfc93ad

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pandas/_libs/tslibs/parsing.pyx

+4-2
Original file line numberDiff line numberDiff line change
@@ -936,8 +936,10 @@ def guess_datetime_format(dt_str: str, bint dayfirst=False) -> str | None:
936936
datetime_attrs_to_format.remove(day_attribute_and_format)
937937
datetime_attrs_to_format.insert(0, day_attribute_and_format)
938938

939-
# same default used by dateutil
940-
default = datetime.now().replace(hour=0, minute=0, second=0, microsecond=0)
939+
# Use this instead of the dateutil default of
940+
# `datetime.now().replace(hour=0, minute=0, second=0, microsecond=0)`
941+
# as that causes issues on the 29th of February.
942+
default = datetime(1970, 1, 1)
941943
try:
942944
parsed_datetime = dateutil_parse(
943945
dt_str,

0 commit comments

Comments
 (0)