Skip to content

Commit 2ea7d0d

Browse files
committed
Fixes to the distinct and distinctBy KDocs after review (second round).
1 parent f13bd01 commit 2ea7d0d

File tree

1 file changed

+36
-32
lines changed
  • core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api

1 file changed

+36
-32
lines changed

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/distinct.kt

Lines changed: 36 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import org.jetbrains.kotlinx.dataframe.annotations.Refine
1010
import org.jetbrains.kotlinx.dataframe.api.DistinctDocs.DESCRIPTION
1111
import org.jetbrains.kotlinx.dataframe.api.DistinctDocs.DISTINCT_PARAM
1212
import org.jetbrains.kotlinx.dataframe.api.DistinctDocs.DISTINCT_RETURN
13-
import org.jetbrains.kotlinx.dataframe.api.DistinctDocs.FUNCTION
1413
import org.jetbrains.kotlinx.dataframe.api.DistinctDocs.PHRASE_ENDING
14+
import org.jetbrains.kotlinx.dataframe.api.DistinctDocs.SEE_ALSO
1515
import org.jetbrains.kotlinx.dataframe.api.Select.SelectSelectingOptions
1616
import org.jetbrains.kotlinx.dataframe.columns.ColumnSet
1717
import org.jetbrains.kotlinx.dataframe.columns.toColumnSet
@@ -29,12 +29,12 @@ import kotlin.reflect.KProperty
2929
// region DataFrame
3030

3131
/**
32-
* {@get [DESCRIPTION] Removes duplicated rows based on {@get [PHRASE_ENDING]}}.
32+
* {@get [DESCRIPTION] Removes duplicated rows based on $[PHRASE_ENDING]=all columns.}
3333
*
3434
* The [rows][DataRow] in the resulting [DataFrame] are in the same order
3535
* as they were in the original [DataFrame].
3636
*
37-
* See also {@get [FUNCTION] [distinctBy] that removes duplicated rows based on the specified columns
37+
* See also {@get [SEE_ALSO] [distinctBy] that removes duplicated rows based on the specified columns
3838
* and keeps all the columns in the resulting [DataFrame].}
3939
*
4040
* @include [SelectingColumns.ColumnGroupsAndNestedColumnsMention]
@@ -43,41 +43,45 @@ import kotlin.reflect.KProperty
4343
*
4444
* For more information:
4545
*
46-
* {@include [DocumentationUrls.Distinct]}
46+
* @include [DocumentationUrls.Distinct]
4747
*
48-
* {@include [DocumentationUrls.DistinctBy]}
48+
* @include [DocumentationUrls.DistinctBy]
4949
*
50-
* {@get [DISTINCT_PARAM]}
50+
* @get [DISTINCT_PARAM]
5151
*
5252
* @return {@get [DISTINCT_RETURN] A new [DataFrame] containing only distinct rows.}
5353
*/
5454
@ExcludeFromSources
5555
@Suppress("ClassName")
5656
private interface DistinctDocs {
57+
// Parameter of the function (the `@param` part of the KDoc)
5758
interface DISTINCT_PARAM
5859

60+
// Value returned by the function (the `@return` part of the KDoc)
5961
interface DISTINCT_RETURN
6062

63+
// Description of what the function does
6164
interface DESCRIPTION
6265

66+
// Part of the description that can be customized for a specific function
6367
interface PHRASE_ENDING
6468

65-
interface FUNCTION
69+
// Reference to a related function (see also)
70+
interface SEE_ALSO
6671
}
6772

6873
/**
69-
* {@include [DistinctDocs]}
70-
* {@set [PHRASE_ENDING] all columns}
71-
* {@set [DISTINCT_PARAM]}
74+
* @include [DistinctDocs]
75+
* @set [DISTINCT_PARAM]
7276
*/
7377
public fun <T> DataFrame<T>.distinct(): DataFrame<T> = distinctBy { all() }
7478

7579
/**
76-
* {@include [DistinctDocs]}
77-
* {@set [DESCRIPTION] Selects the specified columns and keeps only distinct rows based on these selected columns}
78-
* {@set [DISTINCT_PARAM] @param [columns\] The [ColumnsSelector] used to select columns
79-
* that will be included in the resulting [DataFrame] and considered for evaluating distinct rows.}
80-
* {@set [DISTINCT_RETURN] A new [DataFrame] containing only selected columns and distinct rows.}
80+
* @include [DistinctDocs]
81+
* @set [DESCRIPTION] Selects the specified columns and keeps only distinct rows based on these selected columns.
82+
* @set [DISTINCT_PARAM] @param [columns\] The [ColumnsSelector] used to select columns
83+
* that will be included in the resulting [DataFrame] and considered for evaluating distinct rows.
84+
* @set [DISTINCT_RETURN] A new [DataFrame] containing only selected columns and distinct rows.
8185
*/
8286
@Refine
8387
@Interpretable("Distinct0")
@@ -92,11 +96,11 @@ public fun <T> DataFrame<T>.distinct(vararg columns: KProperty<*>): DataFrame<T>
9296
}
9397

9498
/**
95-
* {@include [DistinctDocs]}
96-
* {@set [DESCRIPTION] Selects the specified columns and keeps only distinct rows based on these selected columns}
97-
* {@set [DISTINCT_PARAM] @param [columns\] The names of the columns to select
98-
* and to consider for evaluating distinct rows.}
99-
* {@set [DISTINCT_RETURN] A new [DataFrame] containing only selected columns and distinct rows.}
99+
* @include [DistinctDocs]
100+
* @set [DESCRIPTION] Selects the specified columns and keeps only distinct rows based on these selected columns.
101+
* @set [DISTINCT_PARAM] @param [columns\] The names of the columns to select
102+
* and to consider for evaluating distinct rows.
103+
* @set [DISTINCT_RETURN] A new [DataFrame] containing only selected columns and distinct rows.
100104
*/
101105
public fun <T> DataFrame<T>.distinct(vararg columns: String): DataFrame<T> = distinct { columns.toColumnSet() }
102106

@@ -111,13 +115,13 @@ public fun <T> DataFrame<T>.distinctBy(vararg columns: KProperty<*>): DataFrame<
111115
distinctBy { columns.toColumnSet() }
112116

113117
/**
114-
* {@include [DistinctDocs]}
115-
* {@set [PHRASE_ENDING] the specified columns}
116-
* {@set [FUNCTION] [distinct] that selects the specified columns
118+
* @include [DistinctDocs]
119+
* {@set [PHRASE_ENDING] the specified}
120+
* @set [SEE_ALSO] [distinct] that selects the specified columns
117121
* (if the columns are not specified, selects all columns)
118-
* and keeps only distinct rows based on these selected columns.}
119-
* {@set [DISTINCT_PARAM] @param [columns\]
120-
* The names of the columns to consider for evaluating distinct rows.}
122+
* and keeps only distinct rows based on these selected columns.
123+
* @set [DISTINCT_PARAM] @param [columns\]
124+
* The names of the columns to consider for evaluating distinct rows.
121125
*/
122126
public fun <T> DataFrame<T>.distinctBy(vararg columns: String): DataFrame<T> = distinctBy { columns.toColumnSet() }
123127

@@ -127,13 +131,13 @@ public fun <T> DataFrame<T>.distinctBy(vararg columns: AnyColumnReference): Data
127131
distinctBy { columns.toColumnSet() }
128132

129133
/**
130-
* {@include [DistinctDocs]}
131-
* {@set [PHRASE_ENDING] the specified columns}
132-
* {@set [FUNCTION] [distinct] that selects the specified columns
134+
* @include [DistinctDocs]
135+
* {@set [PHRASE_ENDING] the specified}
136+
* @set [SEE_ALSO] [distinct] that selects the specified columns
133137
* (if the columns are not specified, selects all columns)
134-
* and keeps only distinct rows based on these selected columns.}
135-
* {@set [DISTINCT_PARAM] @param [columns\] The [ColumnsSelector] used to select columns
136-
* that will be considered for evaluating distinct rows.}
138+
* and keeps only distinct rows based on these selected columns.
139+
* @set [DISTINCT_PARAM] @param [columns\] The [ColumnsSelector] used to select columns
140+
* that will be considered for evaluating distinct rows.
137141
*/
138142
public fun <T, C> DataFrame<T>.distinctBy(columns: ColumnsSelector<T, C>): DataFrame<T> {
139143
val cols = get(columns)

0 commit comments

Comments
 (0)