-
-
Notifications
You must be signed in to change notification settings - Fork 138
Add missing head, head(n), and first methods for TypedDatasets. #230
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #230 +/- ##
==========================================
- Coverage 96.66% 96.62% -0.05%
==========================================
Files 52 52
Lines 960 859 -101
Branches 13 10 -3
==========================================
- Hits 928 830 -98
+ Misses 32 29 -3
Continue to review full report at Codecov.
|
|
@OlivierBlanvillain this should be a pretty easy review. Give it a look when you have any time. |
|
These where voluntarily left out, In general, I really dislike having two APIs for the same thing (first/head, where/filter and so on), so the approach so far has been to include only one variation, but that's maybe something to reconsider... |
|
Thank you @OlivierBlanvillain, yea, now it's clear to me. It was just one night me trying to write a frameless tutoria and realized However, if even me, that wrote some parts of the library hit a (temporary) wall that prevents a direct translation of my familiarity with the vanilla Spark APIs into frameless, it makes me wonder if other, casual users, have the same experience. In some way, I am a a Clearly, adding the APIs the way are coded this PR is wrong, so no question there. However, I am really entertaining the idea of adding headOption and head(n) to be aliases to firstOption and take(n) respectively. Just for the sake of familiarity. |
Sounds good to me, we could even add @deprecated head and first methods, just for discoverability. |
| /** Alias for [[firstOption()]]. | ||
| */ | ||
| @deprecated("Use headOption or firstOption instead.", "0.5.0") | ||
| def head[F[_]]()(implicit F: SparkDelay[F]): F[Option[T]] = firstOption() |
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 would match the vanilla signature to simplify migration. Deprecation is already harsh enough 😄
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 though giving them the same method name was enough :D. Let me resolve the conflicts on this one after merging #153. I can make them just forward the result to vanilla head and first.
…cation for head, first for familiarity.
Just realized that these basic methods are missing. You can always get the by resulting back to
.dataset, but this way is much easier.