Skip to content

Commit 4a75ea4

Browse files
authored
Merge pull request #1033 from Kotlin/post-0.15-deprecations-update
Post 0.15 deprecations update
2 parents b3306cb + 6fe6a57 commit 4a75ea4

File tree

9 files changed

+12
-129
lines changed

9 files changed

+12
-129
lines changed

core/api/core.api

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

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/DataColumn.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ public interface DataColumn<out T> : BaseColumn<T> {
224224
@Deprecated(
225225
message = CREATE_FRAME_COLUMN,
226226
replaceWith = ReplaceWith(CREATE_FRAME_COLUMN_REPLACE, CHUNKED_IMPL_IMPORT),
227-
level = DeprecationLevel.WARNING,
227+
level = DeprecationLevel.ERROR,
228228
)
229229
public fun <T> createFrameColumn(name: String, df: DataFrame<T>, startIndices: Iterable<Int>): FrameColumn<T> =
230230
df.chunkedImpl(startIndices = startIndices, name = name)
@@ -236,7 +236,7 @@ public interface DataColumn<out T> : BaseColumn<T> {
236236
CREATE_BY_INFERENCE_IMPORT,
237237
TYPE_SUGGESTION_IMPORT,
238238
),
239-
level = DeprecationLevel.WARNING,
239+
level = DeprecationLevel.ERROR,
240240
)
241241
public fun <T> createWithTypeInference(
242242
name: String,
@@ -253,7 +253,7 @@ public interface DataColumn<out T> : BaseColumn<T> {
253253
@Deprecated(
254254
message = CREATE,
255255
replaceWith = ReplaceWith(CREATE_REPLACE, CREATE_BY_TYPE_IMPORT),
256-
level = DeprecationLevel.WARNING,
256+
level = DeprecationLevel.ERROR,
257257
)
258258
public fun <T> create(
259259
name: String,
@@ -271,7 +271,7 @@ public interface DataColumn<out T> : BaseColumn<T> {
271271
@Deprecated(
272272
message = CREATE,
273273
replaceWith = ReplaceWith(CREATE_INLINE_REPLACE, CREATE_BY_TYPE_IMPORT),
274-
level = DeprecationLevel.WARNING,
274+
level = DeprecationLevel.ERROR,
275275
)
276276
public inline fun <reified T> create(name: String, values: List<T>, infer: Infer = Infer.None): DataColumn<T> =
277277
createByType(name = name, values = values, type = typeOf<T>(), infer = infer)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public fun AnyCol.isList(): Boolean = typeClass == List::class
5757
@Deprecated(
5858
message = IS_COMPARABLE,
5959
replaceWith = ReplaceWith(IS_COMPARABLE_REPLACE, IS_INTER_COMPARABLE_IMPORT),
60-
level = DeprecationLevel.WARNING,
60+
level = DeprecationLevel.ERROR,
6161
)
6262
public fun AnyCol.isComparable(): Boolean = valuesAreComparable()
6363

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

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,6 @@ import org.jetbrains.kotlinx.dataframe.documentation.ExcludeFromSources
1212
import org.jetbrains.kotlinx.dataframe.documentation.Indent
1313
import org.jetbrains.kotlinx.dataframe.documentation.LineBreak
1414
import org.jetbrains.kotlinx.dataframe.impl.columns.TransformableColumnSet
15-
import org.jetbrains.kotlinx.dataframe.util.COL_ENDS_WITH
16-
import org.jetbrains.kotlinx.dataframe.util.COL_ENDS_WITH_REPLACE
17-
import org.jetbrains.kotlinx.dataframe.util.COL_STARTS_WITH
18-
import org.jetbrains.kotlinx.dataframe.util.COL_STARTS_WITH_REPLACE
19-
import org.jetbrains.kotlinx.dataframe.util.ENDS_WITH
20-
import org.jetbrains.kotlinx.dataframe.util.ENDS_WITH_REPLACE
21-
import org.jetbrains.kotlinx.dataframe.util.STARTS_WITH
22-
import org.jetbrains.kotlinx.dataframe.util.STARTS_WITH_REPLACE
2315
import kotlin.reflect.KProperty
2416

2517
// region ColumnsSelectionDsl
@@ -501,57 +493,6 @@ public interface ColumnNameFiltersColumnsSelectionDsl {
501493
): TransformableColumnSet<*> = columnGroup(this).colsNameEndsWith(suffix, ignoreCase)
502494

503495
// endregion
504-
505-
// region deprecations
506-
507-
@Deprecated(
508-
message = STARTS_WITH,
509-
replaceWith = ReplaceWith(STARTS_WITH_REPLACE),
510-
level = DeprecationLevel.ERROR,
511-
)
512-
public fun <C> ColumnSet<C>.startsWith(prefix: CharSequence): TransformableColumnSet<C> = nameStartsWith(prefix)
513-
514-
@Deprecated(
515-
message = STARTS_WITH,
516-
replaceWith = ReplaceWith(STARTS_WITH_REPLACE),
517-
level = DeprecationLevel.ERROR,
518-
)
519-
public fun ColumnsSelectionDsl<*>.startsWith(prefix: CharSequence): TransformableColumnSet<*> =
520-
nameStartsWith(prefix)
521-
522-
@Deprecated(
523-
message = COL_STARTS_WITH,
524-
replaceWith = ReplaceWith(COL_STARTS_WITH_REPLACE),
525-
level = DeprecationLevel.ERROR,
526-
)
527-
public fun SingleColumn<DataRow<*>>.startsWith(prefix: CharSequence): TransformableColumnSet<*> =
528-
colsNameStartsWith(prefix)
529-
530-
@Deprecated(
531-
message = ENDS_WITH,
532-
replaceWith = ReplaceWith(ENDS_WITH_REPLACE),
533-
level = DeprecationLevel.ERROR,
534-
)
535-
@Suppress("UNCHECKED_CAST")
536-
public fun <C> ColumnSet<C>.endsWith(suffix: CharSequence): TransformableColumnSet<C> =
537-
colsInternal { it.name.endsWith(suffix) } as TransformableColumnSet<C>
538-
539-
@Deprecated(
540-
message = ENDS_WITH,
541-
replaceWith = ReplaceWith(ENDS_WITH_REPLACE),
542-
level = DeprecationLevel.ERROR,
543-
)
544-
public fun ColumnsSelectionDsl<*>.endsWith(suffix: CharSequence): TransformableColumnSet<*> = nameEndsWith(suffix)
545-
546-
@Deprecated(
547-
message = COL_ENDS_WITH,
548-
replaceWith = ReplaceWith(COL_ENDS_WITH_REPLACE),
549-
level = DeprecationLevel.ERROR,
550-
)
551-
public fun SingleColumn<DataRow<*>>.endsWith(suffix: CharSequence): TransformableColumnSet<*> =
552-
this.ensureIsColumnGroup().colsInternal { it.name.endsWith(suffix) }
553-
554-
// endregion
555496
}
556497

557498
// endregion

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/common.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public fun <T> List<List<T>>.toDataFrame(containsColumns: Boolean = false): AnyF
7676
@Deprecated(
7777
message = IS_URL,
7878
replaceWith = ReplaceWith(IS_URL_REPLACE, IS_URL_IMPORT),
79-
level = DeprecationLevel.WARNING,
79+
level = DeprecationLevel.ERROR,
8080
)
8181
public fun isURL(path: String): Boolean = isUrl(path)
8282

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/csv.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public fun DataFrame.Companion.readDelimStr(
107107
@Deprecated(
108108
message = DF_READ_NO_CSV,
109109
replaceWith = ReplaceWith(DF_READ_NO_CSV_REPLACE),
110-
level = DeprecationLevel.WARNING,
110+
level = DeprecationLevel.ERROR,
111111
)
112112
public fun DataFrame.Companion.read(
113113
fileOrUrl: String,
@@ -248,7 +248,7 @@ private fun getCSVType(path: String): CSVType =
248248
@Deprecated(
249249
message = AS_URL,
250250
replaceWith = ReplaceWith(AS_URL_REPLACE, AS_URL_IMPORT),
251-
level = DeprecationLevel.WARNING,
251+
level = DeprecationLevel.ERROR,
252252
)
253253
public fun asURL(fileOrUrl: String): URL = asUrl(fileOrUrl)
254254

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/util/deprecationMessages.kt

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,6 @@ package org.jetbrains.kotlinx.dataframe.util
77
* Level.ERROR -> Remove
88
*/
99

10-
// region WARNING in 0.14, ERROR in 0.15
11-
12-
private const val MESSAGE_0_15 = "Will be ERROR in 0.15."
13-
14-
internal const val STARTS_WITH = "Use nameStartsWith() instead. $MESSAGE_0_15"
15-
internal const val STARTS_WITH_REPLACE = "this.nameStartsWith(prefix)"
16-
17-
internal const val COL_STARTS_WITH = "Use colsNameStartsWith() instead. $MESSAGE_0_15"
18-
internal const val COL_STARTS_WITH_REPLACE = "this.colsNameStartsWith(prefix)"
19-
20-
internal const val ENDS_WITH = "Use nameEndsWith() instead. $MESSAGE_0_15"
21-
internal const val ENDS_WITH_REPLACE = "this.nameEndsWith(suffix)"
22-
23-
internal const val COL_ENDS_WITH = "Use colsNameEndsWith() instead. $MESSAGE_0_15"
24-
internal const val COL_ENDS_WITH_REPLACE = "this.colsNameEndsWith(suffix)"
25-
2610
// region WARNING in 0.15, ERROR in 0.16
2711

2812
private const val MESSAGE_0_16 = "Will be ERROR in 0.16."

dataframe-geo/src/main/kotlin/org/jetbrains/kotlinx/dataframe/geo/geotools/toGeoDataFrame.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ fun SimpleFeatureCollection.toGeoDataFrame(): GeoDataFrame<*> {
5959
}
6060
}
6161

62-
val geometryColumn = DataColumn.create("geometry", geometries, Infer.Type)
62+
val geometryColumn = DataColumn.createByType("geometry", geometries, Infer.Type)
6363

6464
@Suppress("UNCHECKED_CAST")
6565
return GeoDataFrame((data.toDataFrame() + geometryColumn) as DataFrame<WithGeometry>, crs)

dataframe-geo/src/main/kotlin/org/jetbrains/kotlinx/dataframe/geo/io/read.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import org.geotools.geojson.feature.FeatureJSON
66
import org.jetbrains.kotlinx.dataframe.DataFrame
77
import org.jetbrains.kotlinx.dataframe.geo.GeoDataFrame
88
import org.jetbrains.kotlinx.dataframe.geo.geotools.toGeoDataFrame
9-
import org.jetbrains.kotlinx.dataframe.io.asURL
9+
import org.jetbrains.kotlinx.dataframe.io.asUrl
1010
import java.net.URL
1111

12-
fun GeoDataFrame.Companion.readGeoJson(path: String): GeoDataFrame<*> = readGeoJson(asURL(path))
12+
fun GeoDataFrame.Companion.readGeoJson(path: String): GeoDataFrame<*> = readGeoJson(asUrl(path))
1313

1414
fun GeoDataFrame.Companion.readGeoJson(url: URL): GeoDataFrame<*> =
1515
url.openStream().use { inputStream ->
@@ -21,7 +21,7 @@ fun DataFrame.Companion.readGeoJson(path: String): GeoDataFrame<*> = GeoDataFram
2121

2222
fun DataFrame.Companion.readGeoJson(url: URL): GeoDataFrame<*> = GeoDataFrame.readGeoJson(url)
2323

24-
fun GeoDataFrame.Companion.readShapefile(path: String): GeoDataFrame<*> = readShapefile(asURL(path))
24+
fun GeoDataFrame.Companion.readShapefile(path: String): GeoDataFrame<*> = readShapefile(asUrl(path))
2525

2626
fun GeoDataFrame.Companion.readShapefile(url: URL): GeoDataFrame<*> {
2727
val dataStore = ShapefileDataStoreFactory().createDataStore(url)

0 commit comments

Comments
 (0)