-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch time string parsing to tryparse
to handle Julia 1.6.6 change
#248
Conversation
Turns out I was testing locally with Julia 1.6.5, and this fails locally with 1.6.6 |
src/parsing.jl
Outdated
if !(err isa InexactError) | ||
rethrow(err) | ||
try | ||
return parse(Time, _trunc_seconds(str)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a fan of how errors from _trunc_seconds
are effectively ignored by this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be worth while to just always call _trunc_seconds
on str
?
IE, to change this function to
pqparse(::Type{Time}, str::AbstractString) = parse(Time, _trunc_seconds(str))
If it generates an InexactError on 1.6.5 AND current stable I think we have a case for this being a Julia bug in 1.6.6 |
My best guess is that this was introduced by this change: JuliaLang/julia#44004 When I test this on Julia 1.7 I get and
This change isn't part of 1.7: https://github.com/JuliaLang/julia/blob/v1.7.2/stdlib/Dates/src/io.jl#L153 |
tryparse
to handle Julia 1.6.6 change
I'm confused; does |
Yes, in Julia 1.6.5 and 1.7.2 it throws 1.6.6:
1.7.2:
|
Let's put the new behaviour and old behaviour in there and guard with a |
I've added some version based logic |
3a1992c
to
565265d
Compare
Bump the version to 1.13 and we can merge and tag |
dd7e1aa
to
e94033c
Compare
updated |
When
parse(Time, str)
fails forstr="13:13:13142"
onUbuntuJulia 1.6.6, anArgumentError
is thrown instead of anInexactError
, but when usingtryparse
nothing
is returnedThis switches updates the logic to handle the new return type
Reference links:
throw InexactError
fromtryparsenext
JuliaLang/julia#44004