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 Nulls.fail() iterator #32

Merged
merged 1 commit into from
Sep 27, 2017
Merged

Add Nulls.fail() iterator #32

merged 1 commit into from
Sep 27, 2017

Conversation

nalimilan
Copy link
Member

@nalimilan nalimilan commented Sep 27, 2017

Provided by DataArrays as each_nafail(). It simply iterates over the
input and throws an error if a null is found.

Provided by DataArrays as each_nafail(). It simply iterates over the
input and throws an error if a null is found.
@codecov-io
Copy link

codecov-io commented Sep 27, 2017

Codecov Report

Merging #32 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #32   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           1      1           
  Lines          50     53    +3     
=====================================
+ Hits           50     53    +3
Impacted Files Coverage Δ
src/Nulls.jl 100% <100%> (ø) ⬆️

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 53878ba...b143ac4. Read the comment docs.

@quinnj quinnj merged commit 6b9dd47 into master Sep 27, 2017
@quinnj quinnj deleted the nl/fail branch September 27, 2017 17:20
@ararslan
Copy link
Member

I've actually never understood the purpose of that function in DataArrays. It seems equally easy (and much clearer) to do

any(isnull, x) && throw(NullException())

explicitly in user code as needed.

@nalimilan
Copy link
Member Author

I wanted to use exactly that construct in @deprecate, but I realized it would be slow if you actually expect there are no nulls in the data: then any(isnull, x) requires iterating over the whole vector, before likely doing that once again to do the actual operation. Better do the check on the fly.

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.

4 participants