-
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
| * {@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.
I changed the description of the parameter for some functions to mention that it is also used to select 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.
it's also not "the names" here
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.
but as this function is deprecated, you can probably remove the kdocs altogether
| * {@include [DistinctDocs]} | ||
| * {@set NAME DistinctBy} | ||
| * {@set PHRASE_ENDING the specified columns}. | ||
| * {@set [DistinctDocs.DISTINCT_PARAM] @param [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.
I specified this explicitly for this and the following functions (instead of keeping the default option in the common section in DistinctDocs) to avoid the issue with [columns] I mentioned in the description of the PR.
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
}| * @return A new DataFrame containing only distinct rows. | ||
| * {@get [DISTINCT_RETURN] @return A new [DataFrame] containing only distinct rows.} | ||
| * | ||
| * @see [Selecting Columns][SelectSelectingOptions]. |
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.
Let's rewrite this section with our template:
| * @include [SelectingColumns.ColumnGroupsAndNestedColumnsMention] |
Something like that
See also [distinctBy], that (write difference here)
@include [SelectingColumns.ColumnGroupsAndNestedColumnsMention]
See [Selecting Columns][ConvertSelectingOptions].
For more information: {@include [DocumentationUrls.Distinct]}
| /** | ||
| * {@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 |
| * {@get [DISTINCT_RETURN] @return A new [DataFrame] containing only distinct rows.} | ||
| * | ||
| * @see [Selecting Columns][SelectSelectingOptions]. | ||
| * @see {@include [DocumentationUrls.Distinct]} |
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.
never used @see like that :o seems to work well!
| * {@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.
| * {@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 also not "the names" here
| * {@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.
but as this function is deprecated, you can probably remove the kdocs altogether
| * ## 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