-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -3,9 +3,11 @@ package org.jetbrains.kotlinx.dataframe.api | |||
| import org.jetbrains.kotlinx.dataframe.AnyColumnReference | ||||
| import org.jetbrains.kotlinx.dataframe.ColumnsSelector | ||||
| import org.jetbrains.kotlinx.dataframe.DataFrame | ||||
| import org.jetbrains.kotlinx.dataframe.DataRow | ||||
| import org.jetbrains.kotlinx.dataframe.annotations.AccessApiOverload | ||||
| import org.jetbrains.kotlinx.dataframe.annotations.Interpretable | ||||
| import org.jetbrains.kotlinx.dataframe.annotations.Refine | ||||
| import org.jetbrains.kotlinx.dataframe.api.DistinctDocs.DISTINCT_RETURN | ||||
| import org.jetbrains.kotlinx.dataframe.api.Select.SelectSelectingOptions | ||||
| import org.jetbrains.kotlinx.dataframe.columns.ColumnSet | ||||
| import org.jetbrains.kotlinx.dataframe.columns.SingleColumn | ||||
|
|
@@ -23,24 +25,27 @@ import kotlin.reflect.KProperty | |||
| // region DataFrame | ||||
|
|
||||
| /** | ||||
| * ## The Distinct Operation | ||||
| * ## 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}}. | ||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please, change in all kdocs "It removes .." -> "Removes .."
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please make sure all
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then I need to include private interface DistinctDocs {
interface DISTINCT_PARAM
interface DISTINCT_RETURN
interface DESCRIPTION
interface PHRASE_ENDING
} |
||||
| * | ||||
| * __NOTE:__ The rows in the resulting [DataFrame] are in the same order as they were in the original [DataFrame]. | ||||
| * __NOTE:__ The [rows][DataRow] in the resulting [DataFrame] are in the same order | ||||
Allex-Nik marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
| * as they were in the original [DataFrame]. | ||||
| * | ||||
| * {@get [DISTINCT_PARAM] @param [columns] | ||||
| * The names of the columns to consider for evaluating distinct rows.} | ||||
| * {@get [DISTINCT_PARAM]} | ||||
| * | ||||
| * @return A new DataFrame containing only distinct rows. | ||||
| * {@get [DISTINCT_RETURN] @return A new [DataFrame] containing only distinct rows.} | ||||
Allex-Nik marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
| * | ||||
| * @see [Selecting Columns][SelectSelectingOptions]. | ||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's rewrite this section with our template:
Something like that |
||||
| * @see {@include [DocumentationUrls.Distinct]} | ||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. never used |
||||
| * @see {@include [DocumentationUrls.DistinctBy]} | ||||
| */ | ||||
| @ExcludeFromSources | ||||
| @Suppress("ClassName") | ||||
| private interface DistinctDocs { | ||||
| interface DISTINCT_PARAM | ||||
|
|
||||
| interface DISTINCT_RETURN | ||||
Allex-Nik marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
| } | ||||
|
|
||||
| /** | ||||
|
|
@@ -52,15 +57,21 @@ public fun <T> DataFrame<T>.distinct(): DataFrame<T> = distinctBy { all() } | |||
|
|
||||
| /** | ||||
| * {@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 | ||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's probably best to just write the |
||||
| * and to consider for evaluating distinct rows.} | ||||
| * {@set [DISTINCT_RETURN] @return A new [DataFrame] containing only selected columns and distinct rows.} | ||||
| */ | ||||
| @Refine | ||||
| @Interpretable("Distinct0") | ||||
| public fun <T, C> DataFrame<T>.distinct(columns: ColumnsSelector<T, C>): DataFrame<T> = select(columns).distinct() | ||||
|
|
||||
| /** | ||||
| * {@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 | ||||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's also not "the names" here
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||||
| * and to consider for evaluating distinct rows.} | ||||
| * {@set [DISTINCT_RETURN] @return A new [DataFrame] containing only selected columns and distinct rows.} | ||||
| */ | ||||
| @Deprecated(DEPRECATED_ACCESS_API) | ||||
| @AccessApiOverload | ||||
|
|
@@ -72,13 +83,19 @@ public fun <T> DataFrame<T>.distinct(vararg columns: KProperty<*>): DataFrame<T> | |||
|
|
||||
| /** | ||||
| * {@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 | ||||
| * and to consider for evaluating distinct rows.} | ||||
| * {@set [DISTINCT_RETURN] @return A new [DataFrame] containing only selected columns and distinct rows.} | ||||
| */ | ||||
| public fun <T> DataFrame<T>.distinct(vararg columns: String): DataFrame<T> = distinct { columns.toColumnSet() } | ||||
|
|
||||
| /** | ||||
| * {@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 | ||||
| * and to consider for evaluating distinct rows.} | ||||
| * {@set [DISTINCT_RETURN] @return A new [DataFrame] containing only selected columns and distinct rows.} | ||||
| */ | ||||
| @Deprecated(DEPRECATED_ACCESS_API) | ||||
| @AccessApiOverload | ||||
|
|
@@ -87,7 +104,10 @@ public fun <T> DataFrame<T>.distinct(vararg columns: AnyColumnReference): DataFr | |||
|
|
||||
| /** | ||||
| * {@include [DistinctDocs]} | ||||
| * {@set NAME DistinctBy} | ||||
| * {@set PHRASE_ENDING the specified columns}. | ||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. change to |
||||
| * {@set [DistinctDocs.DISTINCT_PARAM] @param [columns] | ||||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||||
| * The names of the columns to consider for evaluating distinct rows.} | ||||
| */ | ||||
| @Deprecated(DEPRECATED_ACCESS_API) | ||||
| @AccessApiOverload | ||||
|
|
@@ -96,13 +116,19 @@ public fun <T> DataFrame<T>.distinctBy(vararg columns: KProperty<*>): DataFrame< | |||
|
|
||||
| /** | ||||
| * {@include [DistinctDocs]} | ||||
| * {@set NAME DistinctBy} | ||||
| * {@set PHRASE_ENDING the specified columns}. | ||||
| * {@set [DistinctDocs.DISTINCT_PARAM] @param [columns] | ||||
| * The names of the columns to consider for evaluating distinct rows.} | ||||
| */ | ||||
| public fun <T> DataFrame<T>.distinctBy(vararg columns: String): DataFrame<T> = distinctBy { columns.toColumnSet() } | ||||
|
|
||||
| /** | ||||
| * {@include [DistinctDocs]} | ||||
| * {@set NAME DistinctBy} | ||||
| * {@set PHRASE_ENDING the specified columns}. | ||||
| * {@set [DistinctDocs.DISTINCT_PARAM] @param [columns] | ||||
| * The names of the columns to consider for evaluating distinct rows.} | ||||
| */ | ||||
| @Deprecated(DEPRECATED_ACCESS_API) | ||||
| @AccessApiOverload | ||||
|
|
@@ -111,7 +137,10 @@ public fun <T> DataFrame<T>.distinctBy(vararg columns: AnyColumnReference): Data | |||
|
|
||||
| /** | ||||
| * {@include [DistinctDocs]} | ||||
| * {@set NAME DistinctBy} | ||||
| * {@set PHRASE_ENDING the specified columns}. | ||||
| * {@set [DistinctDocs.DISTINCT_PARAM] @param [columns] | ||||
| * The names of the columns to consider for evaluating distinct rows.} | ||||
| */ | ||||
| public fun <T, C> DataFrame<T>.distinctBy(columns: ColumnsSelector<T, C>): DataFrame<T> { | ||||
| val cols = get(columns) | ||||
|
|
||||
Uh oh!
There was an error while loading. Please reload this page.