Skip to content

Commit

Permalink
Merge pull request #248 from invenia/wy/fix-ubuntu-truncating
Browse files Browse the repository at this point in the history
Switch time string parsing to `tryparse` to handle Julia 1.6.6 change
  • Loading branch information
iamed2 authored May 9, 2022
2 parents 7b13b3e + e94033c commit 5ba8155
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "LibPQ"
uuid = "194296ae-ab2e-5f79-8cd4-7183a0a5a0d1"
license = "MIT"
version = "1.12.0"
version = "1.13.0"

[deps]
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
Expand Down
19 changes: 12 additions & 7 deletions src/parsing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -295,15 +295,20 @@ end

_DEFAULT_TYPE_MAP[:time] = Time
function pqparse(::Type{Time}, str::AbstractString)
try
return parse(Time, str)
catch err
if !(err isa InexactError)
rethrow(err)
@static if v"1.6.6" <= VERSION < v"1.7.0" || VERSION > v"1.7.2"
result = tryparse(Time, str)
# If there's an error we want to see it here
return isnothing(result) ? parse(Time, _trunc_seconds(str)) : result
else
try
return parse(Time, str)
catch err
if !(err isa InexactError)
rethrow(err)
end
end
return parse(Time, _trunc_seconds(str))
end

return parse(Time, _trunc_seconds(str))
end

# InfExtendedTime support for Dates.TimeType
Expand Down

2 comments on commit 5ba8155

@iamed2
Copy link
Collaborator Author

@iamed2 iamed2 commented on 5ba8155 May 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/59965

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.13.0 -m "<description of version>" 5ba8155609af85c7503fbbd2acd0c3bd8600fd94
git push origin v1.13.0

Please sign in to comment.