Skip to content

Commit 56175ea

Browse files
committed
improved error message
1 parent 007a761 commit 56175ea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pandas/_libs/tslibs/parsing.pyx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,16 +161,16 @@ cdef inline object _parse_delimited_date(str date_string, bint dayfirst):
161161
# in C api, thus we call faster C version for 3.6.1 or newer
162162

163163
if dayfirst and not swapped_day_and_month:
164-
warnings.warn(f"Parsing {date_string} MM/DD format.")
164+
warnings.warn(f"Parsing '{date_string}' in MM/DD/YYYY format.")
165165
elif not dayfirst and swapped_day_and_month:
166-
warnings.warn(f"Parsing {date_string} DD/MM format.")
166+
warnings.warn(f"Parsing '{date_string}' in DD/MM/YYYY format.")
167167

168168
return datetime_new(year, month, day, 0, 0, 0, 0, None), reso
169169

170170
if dayfirst and not swapped_day_and_month:
171-
warnings.warn(f"Parsing {date_string} MM/DD format.")
171+
warnings.warn(f"Parsing '{date_string}' in MM/DD/YYYY format.")
172172
elif not dayfirst and swapped_day_and_month:
173-
warnings.warn(f"Parsing {date_string} DD/MM format.")
173+
warnings.warn(f"Parsing '{date_string}' in DD/MM/YYYY format.")
174174

175175
return datetime(year, month, day, 0, 0, 0, 0, None), reso
176176

0 commit comments

Comments
 (0)