Skip to content
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

Add rounding and transposition methods #42

Merged
merged 2 commits into from
Oct 5, 2017
Merged

Add rounding and transposition methods #42

merged 2 commits into from
Oct 5, 2017

Conversation

nalimilan
Copy link
Member

Used to be provided by DataArrays, needed for JuliaStats/DataArrays.jl#288.

Used to be provided by DataArrays.
These used to be provided by DataArrays, and are needed to transpose an
Array{Union{T, Null}} since these functions are called recursively.
for f in (:(Base.ceil), :(Base.floor), :(Base.round), :(Base.trunc))
@eval begin
($f)(::Null, digits::Integer=0, base::Integer=0) = null
($f)(::Type{>:Null}, ::Null) = null
Copy link
Member Author

Choose a reason for hiding this comment

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

This one is a bit special: I've considered round(Int, null) should throw a NullException, but round(Union{Int, Null}, null) should return null. That's safer than returning null whatever the requested type. When NullException supports error messages, we should use it to explain what to do.

Copy link
Member

Choose a reason for hiding this comment

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

👍

@codecov-io
Copy link

codecov-io commented Oct 5, 2017

Codecov Report

Merging #42 into master will increase coverage by 0.27%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #42      +/-   ##
==========================================
+ Coverage   91.86%   92.13%   +0.27%     
==========================================
  Files           1        1              
  Lines          86       89       +3     
==========================================
+ Hits           79       82       +3     
  Misses          7        7
Impacted Files Coverage Δ
src/Nulls.jl 92.13% <100%> (+0.27%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b0a5c55...fc77cc8. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants