Skip to content

Commit 9da60e4

Browse files
committed
Fixed incorrect parsing bug when T separates date and time
1 parent bb79b13 commit 9da60e4

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

pandas/_libs/src/vendored/numpy/datetime/np_datetime_strings.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ int parse_iso_8601_datetime(const char *str, int len, int want_exc,
114114
int format_len,
115115
FormatRequirement format_requirement,
116116
double threshold) {
117-
printf("Start %s\n", str);
118117
if (len < 0 || format_len < 0)
119118
goto parse_error;
120119
int year_leap = 0;
@@ -312,7 +311,6 @@ int parse_iso_8601_datetime(const char *str, int len, int want_exc,
312311
}
313312

314313
year_sep:
315-
printf("Now %s\n", substr);
316314
/* Negate the year if necessary */
317315
if (str[0] == '-') {
318316
out->year = -out->year;
@@ -612,14 +610,7 @@ int parse_iso_8601_datetime(const char *str, int len, int want_exc,
612610

613611
/* Invalidates the component if there is more than 2 digits */
614612
if (sublen > 0) {
615-
int still_more = 1;
616-
for (i = 0; i < valid_ymd_sep_len; ++i) {
617-
if (*substr == valid_ymd_sep[i]) {
618-
still_more = 0;
619-
break;
620-
}
621-
}
622-
if (still_more) {
613+
if (isdigit(substr[0])) {
623614
invalid_components++;
624615
while (sublen > 0 && isdigit(substr[0])) {
625616
substr++;

0 commit comments

Comments
 (0)