-
Notifications
You must be signed in to change notification settings - Fork 76
Add documentation and tests for the last and lastOrNull functions
#1561
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
base: master
Are you sure you want to change the base?
Conversation
|
The checks fail for now because in the documentation I refer to |
| */ | ||
| class LastTests : ColumnsSelectionDslTests() { | ||
|
|
||
| // region ColumnsSelectionDsl |
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 was thinking that a test file could benefit from these regions as well. Is it a good idea to add it here?
| * and returns a [ReducedGroupBy] containing these rows | ||
| * (one row per group, each row is the last row in its group). | ||
| * | ||
| * If the group in [GroupBy] is empty, |
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 mentioned that it will return null for empty groups, but there is still the issue I mentioned for this case in #1547:
https://github.com/Kotlin/dataframe/pull/1547/files#r2505104735
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.
could you create an issue for that? I probably should have done that myself when finding the reproducer... But it makes it easier to track and refer to :)
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.
Yes, sure! I probably should have done it right away, I just wasn't 100% sure :)
I expect it to be merged soon. If it takes too long, you can also copy the code from #1554 and let git handle the merge. Whatever you like best :) |
| /** | ||
| * Returns the last value in this [DataColumn]. | ||
| * | ||
| * See also [lastOrNull], [first], [take], [takeLast]. |
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.
There's also the @see tag if you just want to refer to other functions.
The only downside of @see is that you cannot add "extra" text to it. That's why we often write things like "See [something] for some reason."
However, if you don't need a description, you can simply write
@see [lastOrNull]
@see [first]
etc.
Fixes #1497