-
Notifications
You must be signed in to change notification settings - Fork 77
KDocs fixes for distinct and distinctBy
#1628
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
b67f0d0 to
37ca771
Compare
|
@Allex-Nik To avoid this problem with I'd even say it's better to write |
AndreiKingsley
left a comment
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.
Nice! Please, remove headers and add cross-references for distinct/distinctBy operations
| * ## The {@get NAME Distinct} Operation | ||
| * | ||
| * It removes duplicated rows based on {@get PHRASE_ENDING}. | ||
| * {@get DESCRIPTION It removes duplicated rows based on {@get PHRASE_ENDING}}. |
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.
Please, change in all kdocs "It removes .." -> "Removes .."
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.
Please make sure all @get/@set keys are [references]. This will work too, but references are refactor- and typo-safe :)
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 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.
Then I need to include DESCRIPTION and PHRASE_ENDING into DistinctDocs like this, right?
private interface DistinctDocs {
interface DISTINCT_PARAM
interface DISTINCT_RETURN
interface DESCRIPTION
interface PHRASE_ENDING
}| /** | ||
| * {@include [DistinctDocs]} | ||
| * {@set NAME DistinctBy} | ||
| * {@set PHRASE_ENDING the specified columns}. |
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.
change to [\columns] here and in other places
TL;DR: write it like Long explanation: Whenever some KDocs is If a reference cannot be found, it's left unchanged as Unfortunately, this system is not perfect (resolving symbols by path in kotlin myself is hard XD), so when you write /** @param [columns] The names of the columns to consider for evaluating distinct rows. */
interface DistinctDocs
/** @include [DistinctDocs] */
public fun <T> DataFrame<T>.distinctBy...KoDEx tries to find Luckily, we have the |
| * {@include [DistinctDocs]} | ||
| * {@set PHRASE_ENDING the specified columns}. | ||
| * {@set DESCRIPTION It selects the specified columns and keeps only distinct rows based on these selected columns} | ||
| * {@set [DistinctDocs.DISTINCT_PARAM] @param [columns] The names of the columns to select |
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.
it's not "The names of the columns" though, it's a columns selector. Check how we write the @param of columnsSelectors in other operations :)
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.
It's probably best to just write the @param line at the bottom of this KDoc, as each overload needs a different line of text for it. Yes, it will be below the @return then, but the IDE still renders it well.
| * ## The {@get NAME Distinct} Operation | ||
| * | ||
| * It removes duplicated rows based on {@get PHRASE_ENDING}. | ||
| * {@get DESCRIPTION It removes duplicated rows based on {@get PHRASE_ENDING}}. |
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.
Please make sure all @get/@set keys are [references]. This will work too, but references are refactor- and typo-safe :)
| * ## The {@get NAME Distinct} Operation | ||
| * | ||
| * It removes duplicated rows based on {@get PHRASE_ENDING}. | ||
| * {@get DESCRIPTION It removes duplicated rows based on {@get PHRASE_ENDING}}. |
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.
Fixes #1434
The documentation for the
distinctfunction with parameters described functionality ofdistinctBy: it suggested thatdistinctremoves duplicated rows omitting the fact that it also selects the specified columns and the result contains only these columns.In this PR I:
distinctdistinctByto DocumentationUrlscolumnsparameter mentioned inDistinctDocs