File tree 3 files changed +7
-3
lines changed
3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 1
1
from numpy cimport int64_t
2
2
3
3
4
- cpdef bint format_is_iso(str f)
5
4
cdef bint parse_today_now(str val, int64_t* iresult, bint utc)
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ from pandas._libs.tslibs.timestamps import Timestamp
54
54
55
55
cnp.import_array()
56
56
57
- cpdef bint format_is_iso(f: str ):
57
+ cdef bint format_is_iso(f: str ):
58
58
"""
59
59
Does format match the iso8601 set that can be handled by the C parser?
60
60
Generally of form YYYY-MM-DDTHH:MM:SS - date separator can be different
@@ -74,6 +74,11 @@ cpdef bint format_is_iso(f: str):
74
74
return False
75
75
76
76
77
+ def _test_format_is_iso (f: str ) -> bool:
78
+ """Only used in testing."""
79
+ return format_is_iso(f )
80
+
81
+
77
82
cdef bint parse_today_now(str val , int64_t* iresult , bint utc ):
78
83
# We delay this check for as long as possible
79
84
# because it catches relatively rare cases
Original file line number Diff line number Diff line change @@ -315,7 +315,7 @@ def test_parse_time_string_check_instance_type_raise_exception():
315
315
)
316
316
def test_is_iso_format (fmt , expected ):
317
317
# see gh-41047
318
- result = strptime .format_is_iso (fmt )
318
+ result = strptime ._test_format_is_iso (fmt )
319
319
assert result == expected
320
320
321
321
You can’t perform that action at this time.
0 commit comments