Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 456f454

Browse files
committedMay 23, 2025·
Remove examples for deprecated overloads from tests
1 parent 1ca32d4 commit 456f454

File tree

6 files changed

+0
-1041
lines changed

6 files changed

+0
-1041
lines changed
 

‎core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api/Access.kt

Lines changed: 0 additions & 260 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import org.jetbrains.kotlinx.dataframe.api.after
77
import org.jetbrains.kotlinx.dataframe.api.chunked
88
import org.jetbrains.kotlinx.dataframe.api.colsOf
99
import org.jetbrains.kotlinx.dataframe.api.column
10-
import org.jetbrains.kotlinx.dataframe.api.columnGroup
1110
import org.jetbrains.kotlinx.dataframe.api.columnOf
1211
import org.jetbrains.kotlinx.dataframe.api.countDistinct
1312
import org.jetbrains.kotlinx.dataframe.api.dataFrameOf
@@ -68,19 +67,6 @@ class Access : TestBase() {
6867
// SampleEnd
6968
}
7069

71-
@Test
72-
@TransformDataFrameExpressions
73-
fun getColumnByName_accessors() {
74-
// SampleStart
75-
val age by column<Int>()
76-
val name by columnGroup()
77-
val lastName by name.column<String>()
78-
79-
df[age]
80-
df[lastName]
81-
// SampleEnd
82-
}
83-
8470
@Test
8571
@TransformDataFrameExpressions
8672
fun getColumnByName_strings() {
@@ -98,16 +84,6 @@ class Access : TestBase() {
9884
// SampleEnd
9985
}
10086

101-
@Test
102-
@TransformDataFrameExpressions
103-
fun getColumn_accessors() {
104-
// SampleStart
105-
val age by column<Int>()
106-
107-
df.getColumn { age }
108-
// SampleEnd
109-
}
110-
11187
@Test
11288
@TransformDataFrameExpressions
11389
fun getColumn_strings() {
@@ -124,16 +100,6 @@ class Access : TestBase() {
124100
// SampleEnd
125101
}
126102

127-
@Test
128-
@TransformDataFrameExpressions
129-
fun getColumnOrNull_accessors() {
130-
// SampleStart
131-
val age by column<Int>()
132-
133-
df.getColumnOrNull(age)
134-
// SampleEnd
135-
}
136-
137103
@Test
138104
@TransformDataFrameExpressions
139105
fun getColumnOrNull_strings() {
@@ -150,17 +116,6 @@ class Access : TestBase() {
150116
// SampleEnd
151117
}
152118

153-
@Test
154-
@TransformDataFrameExpressions
155-
fun getColumns_accessors() {
156-
// SampleStart
157-
val age by column<Int>()
158-
val name by columnGroup()
159-
160-
df.getColumns { age and name }
161-
// SampleEnd
162-
}
163-
164119
@Test
165120
@TransformDataFrameExpressions
166121
fun getColumns_strings() {
@@ -177,16 +132,6 @@ class Access : TestBase() {
177132
// SampleEnd
178133
}
179134

180-
@Test
181-
@TransformDataFrameExpressions
182-
fun getColumnGroup_accessors() {
183-
// SampleStart
184-
val name by columnGroup()
185-
186-
df.getColumnGroup(name)
187-
// SampleEnd
188-
}
189-
190135
@Test
191136
@TransformDataFrameExpressions
192137
fun getColumnGroup_strings() {
@@ -224,23 +169,6 @@ class Access : TestBase() {
224169
// SampleEnd
225170
}
226171

227-
@Test
228-
@TransformDataFrameExpressions
229-
fun getRowByCondition_accessors() {
230-
// SampleStart
231-
val age by column<Int>()
232-
val weight by column<Int?>()
233-
val name by columnGroup()
234-
val firstName by name.column<String>()
235-
236-
df.single { age() == 45 }
237-
df.first { weight() != null }
238-
df.minBy(age)
239-
df.maxBy { firstName().length }
240-
df.maxByOrNull { weight() }
241-
// SampleEnd
242-
}
243-
244172
@Test
245173
@TransformDataFrameExpressions
246174
fun getRowByCondition_strings() {
@@ -271,17 +199,6 @@ class Access : TestBase() {
271199
// SampleEnd
272200
}
273201

274-
@Test
275-
@TransformDataFrameExpressions
276-
fun getCell_accessors() {
277-
// SampleStart
278-
val age by column<String>()
279-
280-
df[age][1]
281-
df[1][age]
282-
// SampleEnd
283-
}
284-
285202
@Test
286203
@TransformDataFrameExpressions
287204
fun getColumnsByName_properties() {
@@ -290,17 +207,6 @@ class Access : TestBase() {
290207
// SampleEnd
291208
}
292209

293-
@Test
294-
@TransformDataFrameExpressions
295-
fun getColumnsByName_accessors() {
296-
// SampleStart
297-
val age by column<Int>()
298-
val weight by column<Int?>()
299-
300-
df[age, weight]
301-
// SampleEnd
302-
}
303-
304210
@Test
305211
@TransformDataFrameExpressions
306212
fun getColumnsByName_strings() {
@@ -317,18 +223,6 @@ class Access : TestBase() {
317223
// SampleEnd
318224
}
319225

320-
@Test
321-
@TransformDataFrameExpressions
322-
fun select_accessors() {
323-
// SampleStart
324-
val age by column<Int>()
325-
val weight by column<Int?>()
326-
327-
df.select { age and weight }
328-
df.select(age, weight)
329-
// SampleEnd
330-
}
331-
332226
@Test
333227
@TransformDataFrameExpressions
334228
fun select_strings() {
@@ -422,20 +316,6 @@ class Access : TestBase() {
422316
// SampleEnd
423317
}
424318

425-
@Test
426-
@TransformDataFrameExpressions
427-
fun filter_accessors() {
428-
// SampleStart
429-
val age by column<Int>()
430-
val name by columnGroup()
431-
val firstName by name.column<String>()
432-
433-
df.filter { age() > 18 && firstName().startsWith("A") }
434-
// or
435-
df.filter { it[age] > 18 && it[firstName].startsWith("A") }
436-
// SampleEnd
437-
}
438-
439319
@Test
440320
@TransformDataFrameExpressions
441321
fun filter_strings() {
@@ -452,15 +332,6 @@ class Access : TestBase() {
452332
// SampleEnd
453333
}
454334

455-
@Test
456-
@TransformDataFrameExpressions
457-
fun filterBy_accessors() {
458-
// SampleStart
459-
val isHappy by column<Boolean>()
460-
df.filterBy { isHappy }
461-
// SampleEnd
462-
}
463-
464335
@Test
465336
@TransformDataFrameExpressions
466337
fun filterBy_strings() {
@@ -477,20 +348,6 @@ class Access : TestBase() {
477348
// SampleEnd
478349
}
479350

480-
@Test
481-
@TransformDataFrameExpressions
482-
fun dropWhere_accessors() {
483-
// SampleStart
484-
val name by columnGroup()
485-
val weight by column<Int?>()
486-
val city by column<String?>()
487-
488-
df.drop { weight() == null || city() == null }
489-
// or
490-
df.drop { it[weight] == null || it[city] == null }
491-
// SampleEnd
492-
}
493-
494351
@Test
495352
@TransformDataFrameExpressions
496353
fun dropWhere_strings() {
@@ -545,18 +402,6 @@ class Access : TestBase() {
545402
// TODO: df["age"][2..4]
546403
}
547404

548-
@Test
549-
@TransformDataFrameExpressions
550-
fun byColumn_accessors() {
551-
// SampleStart
552-
val name by column<String>()
553-
val age by column<Int>()
554-
df[name][0]
555-
df[name, age][3, 5, 6]
556-
// SampleEnd
557-
// TODO: df[age][2..4]
558-
}
559-
560405
@Test
561406
@TransformDataFrameExpressions
562407
fun byColumn_properties() {
@@ -577,18 +422,6 @@ class Access : TestBase() {
577422
// SampleEnd
578423
}
579424

580-
@Test
581-
@TransformDataFrameExpressions
582-
fun byRow_accessors() {
583-
// SampleStart
584-
val name by column<String>()
585-
val age by column<Int>()
586-
df[0][name]
587-
df[3, 5, 6][name, age]
588-
df[3..5][age]
589-
// SampleEnd
590-
}
591-
592425
@Test
593426
@TransformDataFrameExpressions
594427
fun byRow_properties() {
@@ -659,18 +492,6 @@ class Access : TestBase() {
659492
// SampleEnd
660493
}
661494

662-
@Test
663-
@TransformDataFrameExpressions
664-
fun distinctColumns_accessors() {
665-
// SampleStart
666-
val age by column<Int>()
667-
val name by columnGroup()
668-
df.distinct { age and name }
669-
// same as
670-
df.select { age and name }.distinct()
671-
// SampleEnd
672-
}
673-
674495
@Test
675496
@TransformDataFrameExpressions
676497
fun countDistinct() {
@@ -687,16 +508,6 @@ class Access : TestBase() {
687508
// SampleEnd
688509
}
689510

690-
@Test
691-
@TransformDataFrameExpressions
692-
fun countDistinctColumns_accessors() {
693-
// SampleStart
694-
val age by column<Int>()
695-
val name by columnGroup()
696-
df.countDistinct { age and name }
697-
// SampleEnd
698-
}
699-
700511
@Test
701512
@TransformDataFrameExpressions
702513
fun countDistinctColumns_strings() {
@@ -725,20 +536,6 @@ class Access : TestBase() {
725536
// SampleEnd
726537
}
727538

728-
@Test
729-
@TransformDataFrameExpressions
730-
fun distinctBy_accessors() {
731-
// SampleStart
732-
val age by column<Int>()
733-
val name by columnGroup()
734-
val firstName by name.column<String>()
735-
736-
df.distinctBy { age and name }
737-
// same as
738-
df.groupBy { age and name }.mapToRows { group.first() }
739-
// SampleEnd
740-
}
741-
742539
@Test
743540
@TransformDataFrameExpressions
744541
fun distinctBy_strings() {
@@ -798,43 +595,6 @@ class Access : TestBase() {
798595
// SampleEnd
799596
}
800597

801-
@Test
802-
@TransformDataFrameExpressions
803-
fun columnSelectors_accessors() {
804-
// SampleStart
805-
// by column name
806-
val name by columnGroup()
807-
df.select { it[name] }
808-
df.select { name }
809-
810-
// by column path
811-
val firstName by name.column<String>()
812-
df.select { firstName }
813-
814-
// with a new name
815-
df.select { name named "Full Name" }
816-
817-
// converted
818-
df.select { firstName.map { it.lowercase() } }
819-
820-
// column arithmetics
821-
val age by column<Int>()
822-
df.select { 2021 - age }
823-
824-
// two columns
825-
df.select { name and age }
826-
827-
// range of columns
828-
df.select { name..age }
829-
830-
// all columns of ColumnGroup
831-
df.select { name.allCols() }
832-
833-
// traversal of columns at any depth from here excluding ColumnGroups
834-
df.select { name.colsAtAnyDepth { !it.isColumnGroup() } }
835-
// SampleEnd
836-
}
837-
838598
@Test
839599
fun columnSelectors_kproperties() {
840600
// SampleStart
@@ -1019,26 +779,6 @@ class Access : TestBase() {
1019779
// SampleEnd
1020780
}
1021781

1022-
@Test
1023-
@TransformDataFrameExpressions
1024-
fun forRows_accessors() {
1025-
// SampleStart
1026-
val age by column<Int>()
1027-
1028-
for (row in df) {
1029-
println(row[age])
1030-
}
1031-
1032-
df.forEach {
1033-
println(it[age])
1034-
}
1035-
1036-
df.rows().forEach {
1037-
println(it[age])
1038-
}
1039-
// SampleEnd
1040-
}
1041-
1042782
@Test
1043783
@TransformDataFrameExpressions
1044784
fun forRows_strings() {

‎core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api/Analyze.kt

Lines changed: 0 additions & 374 deletions
Large diffs are not rendered by default.

‎core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api/Create.kt

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -112,20 +112,6 @@ class Create : TestBase() {
112112
// SampleEnd
113113
}
114114

115-
@Test
116-
@TransformDataFrameExpressions
117-
fun columnAccessorComputed_accessors() {
118-
// SampleStart
119-
val name by columnGroup()
120-
val firstName by name.column<String>()
121-
val lastName by name.column<String>()
122-
123-
val fullName by column { firstName() + " " + lastName() }
124-
125-
df[fullName]
126-
// SampleEnd
127-
}
128-
129115
@Test
130116
@TransformDataFrameExpressions
131117
fun columnAccessorComputed_strings() {

‎core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api/Join.kt

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import io.kotest.matchers.shouldBe
66
import org.jetbrains.kotlinx.dataframe.DataFrame
77
import org.jetbrains.kotlinx.dataframe.api.add
88
import org.jetbrains.kotlinx.dataframe.api.cast
9-
import org.jetbrains.kotlinx.dataframe.api.column
10-
import org.jetbrains.kotlinx.dataframe.api.columnGroup
119
import org.jetbrains.kotlinx.dataframe.api.excludeJoin
1210
import org.jetbrains.kotlinx.dataframe.api.fullJoin
1311
import org.jetbrains.kotlinx.dataframe.api.getColumnGroup
@@ -34,17 +32,6 @@ class Join : TestBase() {
3432
// SampleEnd
3533
}
3634

37-
@Test
38-
@TransformDataFrameExpressions
39-
fun join_accessors() {
40-
// SampleStart
41-
val name by columnGroup()
42-
val city by column<String>()
43-
44-
df.join(other) { name and city }
45-
// SampleEnd
46-
}
47-
4835
@Test
4936
@TransformDataFrameExpressions
5037
fun join_strings() {
@@ -77,18 +64,6 @@ class Join : TestBase() {
7764
joined.columnsCount() shouldBe df.columnsCount() + 2
7865
}
7966

80-
@Test
81-
@TransformDataFrameExpressions
82-
fun joinWithMatch_accessors() {
83-
val other = df.add("year") { 2021 - age }.select { name named "fullName" and "year" }
84-
// SampleStart
85-
val name by columnGroup()
86-
val fullName by columnGroup()
87-
88-
df.join(other) { name match fullName }
89-
// SampleEnd
90-
}
91-
9267
@Test
9368
@TransformDataFrameExpressions
9469
fun joinWithMatch_strings() {
@@ -110,21 +85,6 @@ class Join : TestBase() {
11085
// SampleEnd
11186
}
11287

113-
@Test
114-
@TransformDataFrameExpressions
115-
fun joinSpecial_accessors() {
116-
// SampleStart
117-
val name by columnGroup()
118-
val city by column<String>()
119-
120-
df.innerJoin(other) { name and city }
121-
df.leftJoin(other) { name and city }
122-
df.rightJoin(other) { name and city }
123-
df.fullJoin(other) { name and city }
124-
df.excludeJoin(other) { name and city }
125-
// SampleEnd
126-
}
127-
12888
@Test
12989
@TransformDataFrameExpressions
13090
fun joinSpecial_strings() {

‎core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api/JoinWith.kt

Lines changed: 0 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import org.jetbrains.kotlinx.dataframe.api.RGBColor
1515
import org.jetbrains.kotlinx.dataframe.api.and
1616
import org.jetbrains.kotlinx.dataframe.api.cast
1717
import org.jetbrains.kotlinx.dataframe.api.colsOf
18-
import org.jetbrains.kotlinx.dataframe.api.column
1918
import org.jetbrains.kotlinx.dataframe.api.convert
2019
import org.jetbrains.kotlinx.dataframe.api.dataFrameOf
2120
import org.jetbrains.kotlinx.dataframe.api.excludeJoinWith
@@ -231,114 +230,6 @@ class JoinWith : TestBase() {
231230
)
232231
}
233232

234-
@TransformDataFrameExpressions
235-
@Test
236-
fun joinWith_accessors() {
237-
val result = run {
238-
// SampleStart
239-
val date by column<LocalDate>()
240-
val startDate by column<LocalDate>()
241-
val endDate by column<LocalDate>()
242-
243-
campaigns.innerJoinWith(visits) {
244-
right[date] in startDate()..endDate()
245-
}
246-
// SampleEnd
247-
}
248-
val coloredResult = coloredCampaigns.innerJoinWith(coloredVisits, joinExpression = joinExpression)
249-
snippetOutput(coloredResult, result)
250-
}
251-
252-
@TransformDataFrameExpressions
253-
@Test
254-
fun filterJoinWith_accessors() {
255-
val result = run {
256-
// SampleStart
257-
val date by column<LocalDate>()
258-
val startDate by column<LocalDate>()
259-
val endDate by column<LocalDate>()
260-
261-
campaigns.filterJoinWith(visits) {
262-
right[date] in startDate()..endDate()
263-
}
264-
// SampleEnd
265-
}
266-
val coloredResult = coloredCampaigns.filterJoinWith(coloredVisits, joinExpression = joinExpression)
267-
snippetOutput(coloredResult, result)
268-
}
269-
270-
@TransformDataFrameExpressions
271-
@Test
272-
fun leftJoinWith_accessors() {
273-
val result = run {
274-
// SampleStart
275-
val date by column<LocalDate>()
276-
val startDate by column<LocalDate>()
277-
val endDate by column<LocalDate>()
278-
279-
campaigns.leftJoinWith(visits) {
280-
right[date] in startDate()..endDate()
281-
}
282-
// SampleEnd
283-
}
284-
val coloredResult = coloredCampaigns.leftJoinWith(coloredVisits, joinExpression = joinExpression)
285-
snippetOutput(coloredResult, result)
286-
}
287-
288-
@TransformDataFrameExpressions
289-
@Test
290-
fun rightJoinWith_accessors() {
291-
val result = run {
292-
// SampleStart
293-
val date by column<LocalDate>()
294-
val startDate by column<LocalDate>()
295-
val endDate by column<LocalDate>()
296-
297-
campaigns.rightJoinWith(visits) {
298-
right[date] in startDate()..endDate()
299-
}
300-
// SampleEnd
301-
}
302-
val coloredResult = coloredCampaigns.rightJoinWith(coloredVisits, joinExpression = joinExpression)
303-
snippetOutput(coloredResult, result)
304-
}
305-
306-
@TransformDataFrameExpressions
307-
@Test
308-
fun fullJoinWith_accessors() {
309-
val result = run {
310-
// SampleStart
311-
val date by column<LocalDate>()
312-
val startDate by column<LocalDate>()
313-
val endDate by column<LocalDate>()
314-
315-
campaigns.fullJoinWith(visits) {
316-
right[date] in startDate()..endDate()
317-
}
318-
// SampleEnd
319-
}
320-
val coloredResult = coloredCampaigns.fullJoinWith(coloredVisits, joinExpression = joinExpression)
321-
snippetOutput(coloredResult, result)
322-
}
323-
324-
@TransformDataFrameExpressions
325-
@Test
326-
fun excludeJoinWith_accessors() {
327-
val result = run {
328-
// SampleStart
329-
val date by column<LocalDate>()
330-
val startDate by column<LocalDate>()
331-
val endDate by column<LocalDate>()
332-
333-
campaigns.excludeJoinWith(visits) {
334-
right[date] in startDate()..endDate()
335-
}
336-
// SampleEnd
337-
}
338-
val coloredResult = coloredCampaigns.excludeJoinWith(coloredVisits, joinExpression = joinExpression)
339-
snippetOutput(coloredResult, result)
340-
}
341-
342233
@TransformDataFrameExpressions
343234
@Test
344235
fun joinWith_strings() {

‎core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api/Modify.kt

Lines changed: 0 additions & 244 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import org.jetbrains.kotlinx.dataframe.api.cast
2121
import org.jetbrains.kotlinx.dataframe.api.castTo
2222
import org.jetbrains.kotlinx.dataframe.api.colsOf
2323
import org.jetbrains.kotlinx.dataframe.api.column
24-
import org.jetbrains.kotlinx.dataframe.api.columnGroup
2524
import org.jetbrains.kotlinx.dataframe.api.columnOf
2625
import org.jetbrains.kotlinx.dataframe.api.concat
2726
import org.jetbrains.kotlinx.dataframe.api.convert
@@ -391,21 +390,6 @@ class Modify : TestBase() {
391390
// SampleEnd
392391
}
393392

394-
@Test
395-
@TransformDataFrameExpressions
396-
fun sortBy_accessors() {
397-
// SampleStart
398-
val age by column<Int>()
399-
val weight by column<Int?>()
400-
val name by columnGroup()
401-
val firstName by name.column<String>()
402-
403-
df.sortBy { age }
404-
df.sortBy { age and firstName }
405-
df.sortBy { weight.nullsLast() }
406-
// SampleEnd
407-
}
408-
409393
@Test
410394
@TransformDataFrameExpressions
411395
fun sortBy_strings() {
@@ -424,17 +408,6 @@ class Modify : TestBase() {
424408
// SampleEnd
425409
}
426410

427-
@Test
428-
@TransformDataFrameExpressions
429-
fun sortByDesc_accessors() {
430-
// SampleStart
431-
val age by column<Int>()
432-
val weight by column<Int?>()
433-
434-
df.sortByDesc { age and weight }
435-
// SampleEnd
436-
}
437-
438411
@Test
439412
@TransformDataFrameExpressions
440413
fun sortByDesc_strings() {
@@ -465,17 +438,6 @@ class Modify : TestBase() {
465438
// SampleEnd
466439
}
467440

468-
@Test
469-
@TransformDataFrameExpressions
470-
fun reorder_accessors() {
471-
// SampleStart
472-
val age by column<Int>()
473-
val isHappy by column<Boolean>()
474-
475-
df.reorder { age..isHappy }.byName()
476-
// SampleEnd
477-
}
478-
479441
@Test
480442
@TransformDataFrameExpressions
481443
fun reorder_strings() {
@@ -514,17 +476,6 @@ class Modify : TestBase() {
514476
// SampleEnd
515477
}
516478

517-
@Test
518-
@TransformDataFrameExpressions
519-
fun splitInplace_accessors() {
520-
// SampleStart
521-
val name by columnGroup()
522-
val firstName by name.column<String>()
523-
524-
df.split { firstName }.by { it.asIterable() }.inplace()
525-
// SampleEnd
526-
}
527-
528479
@Test
529480
@TransformDataFrameExpressions
530481
fun splitInplace_strings() {
@@ -541,17 +492,6 @@ class Modify : TestBase() {
541492
// SampleEnd
542493
}
543494

544-
@Test
545-
@TransformDataFrameExpressions
546-
fun split_accessors() {
547-
// SampleStart
548-
val name by columnGroup()
549-
val lastName by name.column<String>()
550-
551-
df.split { lastName }.by { it.asIterable() }.into("char1", "char2")
552-
// SampleEnd
553-
}
554-
555495
@Test
556496
@TransformDataFrameExpressions
557497
fun split_strings() {
@@ -570,19 +510,6 @@ class Modify : TestBase() {
570510
// SampleEnd
571511
}
572512

573-
@Test
574-
@TransformDataFrameExpressions
575-
fun split1_accessors() {
576-
// SampleStart
577-
val name by columnGroup()
578-
val lastName by name.column<String>()
579-
580-
df.split { lastName }
581-
.by { it.asIterable() }.default(' ')
582-
.inward { "char$it" }
583-
// SampleEnd
584-
}
585-
586513
@Test
587514
@TransformDataFrameExpressions
588515
fun split1_strings() {
@@ -648,19 +575,6 @@ class Modify : TestBase() {
648575
// SampleEnd
649576
}
650577

651-
@Test
652-
@TransformDataFrameExpressions
653-
fun splitIntoRows_accessors() {
654-
// SampleStart
655-
val name by columnGroup()
656-
val firstName by name.column<String>()
657-
658-
df.split { firstName }.by { it.asIterable() }.intoRows()
659-
660-
df.split { name }.by { it.values() }.intoRows()
661-
// SampleEnd
662-
}
663-
664578
@Test
665579
@TransformDataFrameExpressions
666580
fun splitIntoRows_strings() {
@@ -717,19 +631,6 @@ class Modify : TestBase() {
717631
// SampleEnd
718632
}
719633

720-
@Test
721-
@TransformDataFrameExpressions
722-
fun explode_accessors() {
723-
// SampleStart
724-
val a by columnOf(1, 2)
725-
val b by columnOf(listOf(1, 2), listOf(3, 4))
726-
727-
val df = dataFrameOf(a, b)
728-
729-
df.explode { b }
730-
// SampleEnd
731-
}
732-
733634
@Test
734635
@TransformDataFrameExpressions
735636
fun explode_strings() {
@@ -827,17 +728,6 @@ class Modify : TestBase() {
827728
// SampleEnd
828729
}
829730

830-
@Test
831-
@TransformDataFrameExpressions
832-
fun insert_accessors() {
833-
// SampleStart
834-
val year = column<Int>("year of birth")
835-
val age by column<Int>()
836-
837-
df.insert(year) { 2021 - age }.after { age }
838-
// SampleEnd
839-
}
840-
841731
@Test
842732
@TransformDataFrameExpressions
843733
fun insert_strings() {
@@ -939,19 +829,6 @@ class Modify : TestBase() {
939829
// SampleEnd
940830
}
941831

942-
@Test
943-
@TransformDataFrameExpressions
944-
fun add_accessors() {
945-
// SampleStart
946-
val age by column<Int>()
947-
val yearOfBirth by column<Int>("year of birth")
948-
949-
df.add(yearOfBirth) { 2021 - age }
950-
// SampleEnd
951-
val added = df.add(yearOfBirth) { 2021 - age }
952-
added[yearOfBirth].name() shouldBe "year of birth"
953-
}
954-
955832
@Test
956833
@TransformDataFrameExpressions
957834
fun add_strings() {
@@ -1022,22 +899,6 @@ class Modify : TestBase() {
1022899
personWithCityInfo["cityInfo"]["population"] shouldBe df.city.map { it?.length ?: 0 }.named("population")
1023900
}
1024901

1025-
@Test
1026-
@TransformDataFrameExpressions
1027-
fun addCalculated_accessors() {
1028-
// SampleStart
1029-
val city by column<String?>()
1030-
val personWithCityInfo = df.add {
1031-
val cityInfo = city().map { queryCityInfo(it) }
1032-
"cityInfo" {
1033-
cityInfo.map { it.location } into CityInfo::location
1034-
cityInfo.map { it.population } into "population"
1035-
}
1036-
}
1037-
// SampleEnd
1038-
personWithCityInfo["cityInfo"]["population"] shouldBe df.city.map { it?.length ?: 0 }.named("population")
1039-
}
1040-
1041902
@Test
1042903
@TransformDataFrameExpressions
1043904
fun addCalculated_strings() {
@@ -1068,31 +929,6 @@ class Modify : TestBase() {
1068929
// SampleEnd
1069930
}
1070931

1071-
@Test
1072-
@TransformDataFrameExpressions
1073-
fun addMany_accessors() {
1074-
// SampleStart
1075-
val yob = column<Int>("year of birth")
1076-
val lastNameLength = column<Int>("last name length")
1077-
val age by column<Int>()
1078-
val isAdult = column<Boolean>("is adult")
1079-
val fullName = column<String>("full name")
1080-
val name by columnGroup()
1081-
val details by columnGroup()
1082-
val firstName by name.column<String>()
1083-
val lastName by name.column<String>()
1084-
1085-
df.add {
1086-
yob from 2021 - age
1087-
age gt 18 into isAdult
1088-
details from {
1089-
lastName.length() into lastNameLength
1090-
fullName from { firstName() + " " + lastName() }
1091-
}
1092-
}
1093-
// SampleEnd
1094-
}
1095-
1096932
@Test
1097933
@TransformDataFrameExpressions
1098934
fun addMany_strings() {
@@ -1116,17 +952,6 @@ class Modify : TestBase() {
1116952
// SampleEnd
1117953
}
1118954

1119-
@Test
1120-
@TransformDataFrameExpressions
1121-
fun remove_accessors() {
1122-
// SampleStart
1123-
val name by columnGroup()
1124-
val weight by column<Int?>()
1125-
1126-
df.remove { name and weight }
1127-
// SampleEnd
1128-
}
1129-
1130955
@Test
1131956
@TransformDataFrameExpressions
1132957
fun remove_strings() {
@@ -1151,17 +976,6 @@ class Modify : TestBase() {
1151976
// SampleEnd
1152977
}
1153978

1154-
@Test
1155-
@TransformDataFrameExpressions
1156-
fun mapToColumn_accessors() {
1157-
// SampleStart
1158-
val age by column<Int>()
1159-
val yearOfBirth by column<Int>("year of birth")
1160-
1161-
df.mapToColumn(yearOfBirth) { 2021 - age }
1162-
// SampleEnd
1163-
}
1164-
1165979
@Test
1166980
@TransformDataFrameExpressions
1167981
fun mapToColumn_strings() {
@@ -1184,30 +998,6 @@ class Modify : TestBase() {
1184998
// SampleEnd
1185999
}
11861000

1187-
@Test
1188-
@TransformDataFrameExpressions
1189-
fun mapMany_accessors() {
1190-
// SampleStart
1191-
val yob = column<Int>("year of birth")
1192-
val lastNameLength = column<Int>("last name length")
1193-
val age by column<Int>()
1194-
val isAdult = column<Boolean>("is adult")
1195-
val fullName = column<String>("full name")
1196-
val name by columnGroup()
1197-
val firstName by name.column<String>()
1198-
val lastName by name.column<String>()
1199-
val city by column<String?>()
1200-
1201-
df.mapToFrame {
1202-
yob from 2021 - age
1203-
age gt 18 into isAdult
1204-
lastName.length() into lastNameLength
1205-
fullName from { firstName() + " " + lastName() }
1206-
+city
1207-
}
1208-
// SampleEnd
1209-
}
1210-
12111001
@Test
12121002
@TransformDataFrameExpressions
12131003
fun mapMany_strings() {
@@ -1262,19 +1052,6 @@ class Modify : TestBase() {
12621052
// SampleEnd
12631053
}
12641054

1265-
@Test
1266-
@TransformDataFrameExpressions
1267-
fun flatten_accessors() {
1268-
// SampleStart
1269-
val name by columnGroup()
1270-
val firstName by name.column<String>()
1271-
val lastName by name.column<String>()
1272-
// name.firstName -> firstName
1273-
// name.lastName -> lastName
1274-
df.flatten(name)
1275-
// SampleEnd
1276-
}
1277-
12781055
@Test
12791056
@TransformDataFrameExpressions
12801057
fun flatten_KProperties() {
@@ -1497,15 +1274,6 @@ class Modify : TestBase() {
14971274
// SampleEnd
14981275
}
14991276

1500-
@Test
1501-
@TransformDataFrameExpressions
1502-
fun rename_accessors() {
1503-
// SampleStart
1504-
val name by columnGroup()
1505-
df.rename(name).into("fullName")
1506-
// SampleEnd
1507-
}
1508-
15091277
@Test
15101278
@TransformDataFrameExpressions
15111279
fun rename_strings() {
@@ -1525,18 +1293,6 @@ class Modify : TestBase() {
15251293
// SampleEnd
15261294
}
15271295

1528-
@Test
1529-
@TransformDataFrameExpressions
1530-
fun renameExpression_accessors() {
1531-
// SampleStart
1532-
val age by column<Int>()
1533-
df.rename(age).into {
1534-
val mean = it.data.mean()
1535-
"age [mean = $mean]"
1536-
}
1537-
// SampleEnd
1538-
}
1539-
15401296
@Test
15411297
@TransformDataFrameExpressions
15421298
fun renameExpression_strings() {

0 commit comments

Comments
 (0)
Please sign in to comment.