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

isNull and isNotNull added #274

Closed
wants to merge 1 commit into from

Conversation

alfonsorr
Copy link

Added isNull and isNotNull to column.
Part of #164

@imarios
Copy link
Contributor

imarios commented Apr 5, 2018

Hi @alfonsorr and thank you for the PR!

I am kind of skeptical with this API. Assuming that your schema is typed correctly, then anything that may be null should be Optional. So if column X of type Int can be null then it should be Option[Int]. In that case we already have isNone and isNotNone APIs that essentially do exactly this, test for nullability for columns that may be null (that is, columns that have their schema explicitly state that they are optional).

If you look at all APIs in Frameless that may return null, they make that column Optional. So they kind of follow the Sala approach to not using nulls but use Options instead.

I think this API can help only in case you incorrectly specified you schema and you missed a column that is now null where it shouldn't be ...

@OlivierBlanvillain what are your thoughts?

@codecov-io
Copy link

codecov-io commented Apr 5, 2018

Codecov Report

Merging #274 into master will increase coverage by 0.22%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #274      +/-   ##
==========================================
+ Coverage   94.72%   94.94%   +0.22%     
==========================================
  Files          52       52              
  Lines         948      950       +2     
  Branches       10       11       +1     
==========================================
+ Hits          898      902       +4     
+ Misses         50       48       -2
Impacted Files Coverage Δ
dataset/src/main/scala/frameless/TypedColumn.scala 100% <100%> (ø) ⬆️
...c/main/scala/frameless/TypedDatasetForwarded.scala 74.28% <0%> (+2.85%) ⬆️
...src/main/scala/frameless/CatalystNotNullable.scala 66.66% <0%> (+33.33%) ⬆️

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 24d7e0c...800f10f. Read the comment docs.

@alfonsorr
Copy link
Author

I see your point @imarios , and it's true that is repeated. And for the other posibility, I don't see useful to use it in an incorrect schema.

I will try to contribute with other element's, thanks

@imarios
Copy link
Contributor

imarios commented Apr 6, 2018

@alfonsorr I hope this doesn't stop you for contributing! I am sure what you learned doing it (and it was done quite correctly) can be applied to your next contribution.

@imarios imarios closed this Apr 6, 2018
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.

3 participants