From 325ac429ec82093ca64d6e47a37aaddc8c52bcc0 Mon Sep 17 00:00:00 2001 From: Aleksandr Nikolaev Date: Fri, 1 May 2026 12:22:03 +0200 Subject: [PATCH] Remove redundant `toType` overloads in `convert.kt` --- core/api/core.api | 68 -- .../kotlinx/dataframe/api/convert.kt | 1005 +---------------- .../kotlinx/dataframe/samples/api/Convert.kt | 687 +++++++++++ 3 files changed, 700 insertions(+), 1060 deletions(-) create mode 100644 samples/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api/Convert.kt diff --git a/core/api/core.api b/core/api/core.api index 790ce8fa29..9d4267d289 100644 --- a/core/api/core.api +++ b/core/api/core.api @@ -1490,46 +1490,28 @@ public final class org/jetbrains/kotlinx/dataframe/api/ConvertKt { public static final fun to (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlin/reflect/KType;Lorg/jetbrains/kotlinx/dataframe/api/ParserOptions;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static synthetic fun to$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlin/reflect/KType;Lorg/jetbrains/kotlinx/dataframe/api/ParserOptions;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toBigDecimal (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toBigDecimalTAny (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toBigInteger (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toBigIntegerTAny (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toBoolean (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toBooleanTAny (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toDataFrames (Lorg/jetbrains/kotlinx/dataframe/DataColumn;Z)Lorg/jetbrains/kotlinx/dataframe/DataColumn; public static final fun toDataFrames (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Z)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static synthetic fun toDataFrames$default (Lorg/jetbrains/kotlinx/dataframe/DataColumn;ZILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataColumn; public static synthetic fun toDataFrames$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;ZILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toDateTimeComponents (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toDateTimeComponentsFromString (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/format/DateTimeFormat;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static synthetic fun toDateTimeComponentsFromString$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/format/DateTimeFormat;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toDateTimeComponentsFromStringNullable (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/format/DateTimeFormat;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static synthetic fun toDateTimeComponentsFromStringNullable$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/format/DateTimeFormat;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toDateTimeComponentsFromStringNullablePattern (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/String;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toDateTimeComponentsFromStringPattern (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/String;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toDeprecatedInstantFromString (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toDeprecatedInstantFromStringNullable (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toDouble (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toDoubleTAny (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toDuration (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toDurationTAny (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toFloat (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toFloatTAny (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toIframeFromUrl (Lorg/jetbrains/kotlinx/dataframe/api/Convert;ZLjava/lang/Integer;Ljava/lang/Integer;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static synthetic fun toIframeFromUrl$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;ZLjava/lang/Integer;Ljava/lang/Integer;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toIframeFromUrlNullable (Lorg/jetbrains/kotlinx/dataframe/api/Convert;ZLjava/lang/Integer;Ljava/lang/Integer;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static synthetic fun toIframeFromUrlNullable$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;ZLjava/lang/Integer;Ljava/lang/Integer;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toImgFromUrl (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/Integer;Ljava/lang/Integer;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static synthetic fun toImgFromUrl$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/Integer;Ljava/lang/Integer;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toImgFromUrlNullable (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/Integer;Ljava/lang/Integer;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static synthetic fun toImgFromUrlNullable$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/Integer;Ljava/lang/Integer;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toInstantFromString (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toInstantFromStringNullable (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toInt (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toIntTAny (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toJavaDuration (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toJavaDurationTAny (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toJavaInstant (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toJavaInstantTAny (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toJavaLocalDate (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toJavaLocalDateFromString (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/time/format/DateTimeFormatter;Ljava/util/Locale;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static synthetic fun toJavaLocalDateFromString$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/time/format/DateTimeFormatter;Ljava/util/Locale;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; @@ -1539,17 +1521,11 @@ public final class org/jetbrains/kotlinx/dataframe/api/ConvertKt { public static synthetic fun toJavaLocalDateFromStringNullablePattern$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/String;Ljava/util/Locale;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toJavaLocalDateFromStringPattern (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/String;Ljava/util/Locale;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static synthetic fun toJavaLocalDateFromStringPattern$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/String;Ljava/util/Locale;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toJavaLocalDateTAny (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toJavaLocalDateTime (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toJavaLocalDateTimeFromString (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/time/format/DateTimeFormatter;Ljava/util/Locale;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static synthetic fun toJavaLocalDateTimeFromString$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/time/format/DateTimeFormatter;Ljava/util/Locale;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toJavaLocalDateTimeFromStringNullable (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/time/format/DateTimeFormatter;Ljava/util/Locale;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static synthetic fun toJavaLocalDateTimeFromStringNullable$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/time/format/DateTimeFormatter;Ljava/util/Locale;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toJavaLocalDateTimeFromStringNullablePattern (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/String;Ljava/util/Locale;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static synthetic fun toJavaLocalDateTimeFromStringNullablePattern$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/String;Ljava/util/Locale;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toJavaLocalDateTimeFromStringPattern (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/String;Ljava/util/Locale;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static synthetic fun toJavaLocalDateTimeFromStringPattern$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/String;Ljava/util/Locale;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toJavaLocalDateTimeTAny (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toJavaLocalTime (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toJavaLocalTimeFromString (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/time/format/DateTimeFormatter;Ljava/util/Locale;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static synthetic fun toJavaLocalTimeFromString$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/time/format/DateTimeFormatter;Ljava/util/Locale;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; @@ -1559,95 +1535,51 @@ public final class org/jetbrains/kotlinx/dataframe/api/ConvertKt { public static synthetic fun toJavaLocalTimeFromStringNullablePattern$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/String;Ljava/util/Locale;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toJavaLocalTimeFromStringPattern (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/String;Ljava/util/Locale;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static synthetic fun toJavaLocalTimeFromStringPattern$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/String;Ljava/util/Locale;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toJavaLocalTimeTAny (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toLocalDate (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toLocalDateFromDateTimeComponents (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toLocalDateFromDateTimeComponentsNullable (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toLocalDateFromString (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/String;Ljava/util/Locale;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toLocalDateFromString (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/format/DateTimeFormat;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static synthetic fun toLocalDateFromString$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/String;Ljava/util/Locale;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static synthetic fun toLocalDateFromString$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/format/DateTimeFormat;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toLocalDateFromStringNullable (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/String;Ljava/util/Locale;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toLocalDateFromStringNullable (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/format/DateTimeFormat;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static synthetic fun toLocalDateFromStringNullable$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/String;Ljava/util/Locale;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static synthetic fun toLocalDateFromStringNullable$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/format/DateTimeFormat;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toLocalDateFromStringNullablePattern (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/String;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toLocalDateFromStringPattern (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/String;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toLocalDateFromTInt (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static synthetic fun toLocalDateFromTInt$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toLocalDateFromTIntNullable (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static synthetic fun toLocalDateFromTIntNullable$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toLocalDateFromTLong (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static synthetic fun toLocalDateFromTLong$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toLocalDateFromTLongNullable (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static synthetic fun toLocalDateFromTLongNullable$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toLocalDateTime (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toLocalDateTimeFromDateTimeComponents (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toLocalDateTimeFromDateTimeComponentsNullable (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toLocalDateTimeFromString (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/String;Ljava/util/Locale;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toLocalDateTimeFromString (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/format/DateTimeFormat;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static synthetic fun toLocalDateTimeFromString$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/String;Ljava/util/Locale;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static synthetic fun toLocalDateTimeFromString$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/format/DateTimeFormat;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toLocalDateTimeFromStringNullable (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/String;Ljava/util/Locale;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toLocalDateTimeFromStringNullable (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/format/DateTimeFormat;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static synthetic fun toLocalDateTimeFromStringNullable$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/String;Ljava/util/Locale;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static synthetic fun toLocalDateTimeFromStringNullable$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/format/DateTimeFormat;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toLocalDateTimeFromStringNullablePattern (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/String;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toLocalDateTimeFromStringPattern (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/String;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toLocalDateTimeFromTDeprecatedInstant (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static synthetic fun toLocalDateTimeFromTDeprecatedInstant$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toLocalDateTimeFromTDeprecatedInstantNullable (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static synthetic fun toLocalDateTimeFromTDeprecatedInstantNullable$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toLocalDateTimeFromTInt (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static synthetic fun toLocalDateTimeFromTInt$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toLocalDateTimeFromTIntNullable (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static synthetic fun toLocalDateTimeFromTIntNullable$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toLocalDateTimeFromTLong (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static synthetic fun toLocalDateTimeFromTLong$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toLocalDateTimeFromTLongNullable (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static synthetic fun toLocalDateTimeFromTLongNullable$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toLocalDateTimeFromTStdlibInstant (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static synthetic fun toLocalDateTimeFromTStdlibInstant$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toLocalDateTimeFromTStdlibInstantNullable (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static synthetic fun toLocalDateTimeFromTStdlibInstantNullable$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toLocalTime (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toLocalTimeFromDateTimeComponents (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toLocalTimeFromDateTimeComponentsNullable (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toLocalTimeFromString (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/String;Ljava/util/Locale;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toLocalTimeFromString (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/format/DateTimeFormat;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static synthetic fun toLocalTimeFromString$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/String;Ljava/util/Locale;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static synthetic fun toLocalTimeFromString$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/format/DateTimeFormat;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toLocalTimeFromStringNullable (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/String;Ljava/util/Locale;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toLocalTimeFromStringNullable (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/format/DateTimeFormat;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static synthetic fun toLocalTimeFromStringNullable$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/String;Ljava/util/Locale;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static synthetic fun toLocalTimeFromStringNullable$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/format/DateTimeFormat;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toLocalTimeFromStringNullablePattern (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/String;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toLocalTimeFromStringPattern (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Ljava/lang/String;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toLocalTimeFromTInt (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static synthetic fun toLocalTimeFromTInt$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toLocalTimeFromTIntNullable (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static synthetic fun toLocalTimeFromTIntNullable$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toLocalTimeFromTLong (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static synthetic fun toLocalTimeFromTLong$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toLocalTimeFromTLongNullable (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static synthetic fun toLocalTimeFromTLongNullable$default (Lorg/jetbrains/kotlinx/dataframe/api/Convert;Lkotlinx/datetime/TimeZone;ILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toLong (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toLongTAny (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toStdlibInstantFromDateTimeComponents (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toStdlibInstantFromDateTimeComponentsNullable (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toStdlibInstantFromDeprecatedInstant (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toStdlibInstantFromDeprecatedInstantNullable (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toStdlibInstantFromString (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toStdlibInstantFromStringNullable (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toStr (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toStrTAny (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toURLFromString (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toURLFromStringNullable (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toUrlFromString (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toUrlFromStringNullable (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toUtcOffsetFromDateTimeComponents (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toUtcOffsetFromDateTimeComponentsNullable (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; - public static final fun toYearMonthFromDateTimeComponents (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; public static final fun toYearMonthFromDateTimeComponentsNullable (Lorg/jetbrains/kotlinx/dataframe/api/Convert;)Lorg/jetbrains/kotlinx/dataframe/DataFrame; } diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/convert.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/convert.kt index 9ffb19ac5f..31f465c3ef 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/convert.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/convert.kt @@ -955,32 +955,6 @@ public fun Convert.toIFrame( height: Int? = null, ): DataFrame = asColumn { it.map { url -> url?.let { IFRAME(url.toString(), border, width, height) } } } -/** - * Converts values in an [URL] columns previously selected with [convert] to an [IFRAME], - * preserving their original names and positions within the [DataFrame]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { imgUrl }.toIFrame() - * ``` - * - * @param border Whether the iframe should have a border. Defaults to `false`. - * @param width Optional width of the iframe in pixels. - * @param height Optional height of the iframe in pixels. - * @return A new [DataFrame] with the values converted to an [IFRAME]. - */ -@JvmName("toIframeFromUrl") -@Refine -@Converter(IFRAME::class, nullable = false) -@Interpretable("ToSpecificType") -public fun Convert.toIFrame( - border: Boolean = false, - width: Int? = null, - height: Int? = null, -): DataFrame = asColumn { it.map { IFRAME(it.toString(), border, width, height) } } - /** * Converts values in an [URL] columns previously selected with [convert] to an [IMG], * preserving their original names and positions within the [DataFrame]. @@ -1004,28 +978,6 @@ public fun Convert.toIFrame( public fun Convert.toImg(width: Int? = null, height: Int? = null): DataFrame = asColumn { it.map { url -> url?.let { IMG(url.toString(), width, height) } } } -/** - * Converts values in an [URL] columns previously selected with [convert] to an [IMG], - * preserving their original names and positions within the [DataFrame]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { avatarUrl }.toImg() - * ``` - * - * @param width Optional width of the image in pixels. - * @param height Optional height of the image in pixels. - * @return A new [DataFrame] with the values converted to an [IMG]. - */ -@JvmName("toImgFromUrl") -@Refine -@Converter(IMG::class, nullable = false) -@Interpretable("ToSpecificType") -public fun Convert.toImg(width: Int? = null, height: Int? = null): DataFrame = - asColumn { it.map { IMG(it.toString(), width, height) } } - // endregion // region toURL @@ -1079,32 +1031,6 @@ public fun Convert.toURL(): DataFrame = asColumn { it.convert @Interpretable("ToSpecificType") public fun Convert.toUrl(): DataFrame = asColumn { it.convertToUrl() } -@Deprecated(TO_URL, ReplaceWith(TO_URL_REPLACE), DeprecationLevel.ERROR) -@JvmName("toURLFromString") -@Refine -@Converter(URL::class, nullable = false) -@Interpretable("ToSpecificType") -public fun Convert.toURL(): DataFrame = toUrl() - -/** - * Converts values in the [String] columns previously selected with [convert] to an [URL], - * preserving their original names and positions within the [DataFrame]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { webAddress }.toUrl() - * ``` - * - * @return A new [DataFrame] with the values converted to an [URL]. - */ -@JvmName("toUrlFromString") -@Refine -@Converter(URL::class, nullable = false) -@Interpretable("ToSpecificType") -public fun Convert.toUrl(): DataFrame = asColumn { it.convertToUrl() } - // endregion // region toInstant @@ -1245,20 +1171,6 @@ public fun DataColumn.convertToStdlibInstant(): DataColumn< @Deprecated(message = TO_INSTANT, replaceWith = ReplaceWith(TO_INSTANT_REPLACE), level = DeprecationLevel.ERROR) public fun Convert.toInstant(): DataFrame = asColumn { it.convertToDeprecatedInstant() } -/** - * __Deprecated__: - * - * [kotlinx.datetime.Instant] is deprecated in favor of [kotlin.time.Instant]. - * Either migrate to [kotlin.time.Instant] and use [toStdlibInstant] or use [toDeprecatedInstant]. - * This function will be migrated to [kotlin.time.Instant] in 1.1. - */ -@JvmName("toInstantFromString") -@Refine -@Converter(DeprecatedInstant::class, nullable = false) -@Interpretable("ToSpecificType") -@Deprecated(message = TO_INSTANT, replaceWith = ReplaceWith(TO_INSTANT_REPLACE), level = DeprecationLevel.ERROR) -public fun Convert.toInstant(): DataFrame = asColumn { it.convertToDeprecatedInstant() } - /** * Converts values in the [String] columns previously selected with [convert] to [kotlinx.datetime.Instant], * preserving their original names and positions within the [DataFrame]. @@ -1286,32 +1198,6 @@ public fun Convert.toInstant(): DataFrame = asColumn { it.conv ) public fun Convert.toDeprecatedInstant(): DataFrame = asColumn { it.convertToDeprecatedInstant() } -/** - * Converts values in the [String] columns previously selected with [convert] to [kotlinx.datetime.Instant], - * preserving their original names and positions within the [DataFrame]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { timestamp }.toDeprecatedInstant() - * ``` - * - * Migrate to [kotlin.time.Instant] and use [convertToStdlibInstant] at your own pace. - * - * @return A new [DataFrame] with the values converted to [kotlinx.datetime.Instant]. - */ -@JvmName("toDeprecatedInstantFromString") -@Refine -@Converter(DeprecatedInstant::class, nullable = false) -@Interpretable("ToSpecificType") -@Deprecated( - message = TO_DEPRECATED_INSTANT, - replaceWith = ReplaceWith(TO_DEPRECATED_INSTANT_REPLACE), - level = DeprecationLevel.WARNING, -) -public fun Convert.toDeprecatedInstant(): DataFrame = asColumn { it.convertToDeprecatedInstant() } - /** * Converts values in the [String] columns previously selected with [convert] to [kotlin.time.Instant], * preserving their original names and positions within the [DataFrame]. @@ -1334,27 +1220,6 @@ public fun Convert.toDeprecatedInstant(): DataFrame = asColumn @Interpretable("ToSpecificType") public fun Convert.toStdlibInstant(): DataFrame = asColumn { it.convertToStdlibInstant() } -/** - * Converts values in the [String] columns previously selected with [convert] to [kotlin.time.Instant], - * preserving their original names and positions within the [DataFrame]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { timestamp }.toStdlibInstant() - * ``` - * - * This function will be renamed to `.toInstant()` in 1.1. - * - * @return A new [DataFrame] with the values converted to [kotlin.time.Instant]. - */ -@JvmName("toStdlibInstantFromString") -@Refine -@Converter(StdlibInstant::class, nullable = false) -@Interpretable("ToSpecificType") -public fun Convert.toStdlibInstant(): DataFrame = asColumn { it.convertToStdlibInstant() } - /** * Converts values in the [kotlinx.datetime.Instant] columns previously selected with [convert] to [kotlin.time.Instant], * preserving their original names and positions within the [DataFrame]. @@ -1375,25 +1240,6 @@ public fun Convert.toStdlibInstant(): DataFrame = asColumn { i @Interpretable("ToSpecificType") public fun Convert.toStdlibInstant(): DataFrame = asColumn { it.convertToStdlibInstant() } -/** - * Converts values in the [kotlinx.datetime.Instant] columns previously selected with [convert] to the [kotlin.time.Instant], - * preserving their original names and positions within the [DataFrame]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { timestamp }.toStdlibInstant() - * ``` - * - * @return A new [DataFrame] with the values converted to [kotlin.time.Instant]. - */ -@JvmName("toStdlibInstantFromDeprecatedInstant") -@Refine -@Converter(StdlibInstant::class, nullable = false) -@Interpretable("ToSpecificType") -public fun Convert.toStdlibInstant(): DataFrame = asColumn { it.convertToStdlibInstant() } - /** * Converts values in the [DateTimeComponents] columns previously selected with [convert] to [kotlin.time.Instant], * preserving their original names and positions within the [DataFrame]. @@ -1417,26 +1263,6 @@ public fun Convert.toStdlibInstant(): DataFrame = a public fun Convert.toStdlibInstant(): DataFrame = asColumn { it.convertToStdlibInstant() } -/** - * Converts values in the [DateTimeComponents] columns previously selected with [convert] to [kotlin.time.Instant], - * preserving their original names and positions within the [DataFrame]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { timestamp }.toStdlibInstant() - * ``` - * - * This function will be renamed to `.toInstant()` in 1.1. - * - * @return A new [DataFrame] with the values converted to [kotlin.time.Instant]. - */ -@JvmName("toStdlibInstantFromDateTimeComponents") -@Refine -@Converter(StdlibInstant::class, nullable = false) -@Interpretable("ToSpecificType") -public fun Convert.toStdlibInstant(): DataFrame = asColumn { it.convertToStdlibInstant() } // endregion // region toUtcOffset @@ -1471,20 +1297,6 @@ public fun DataColumn.convertToUtcOffset(): DataColumn Convert.toUtcOffset(): DataFrame = asColumn { it.convertToUtcOffset() } -/** - * Converts values in the [DateTimeComponents] columns previously selected with [convert] to [UtcOffset], - * preserving their original names and positions within the [DataFrame]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * @return A new [DataFrame] with the values converted to [UtcOffset]. - */ -@JvmName("toUtcOffsetFromDateTimeComponents") -@Refine -@Converter(UtcOffset::class, nullable = false) -@Interpretable("ToSpecificType") -public fun Convert.toUtcOffset(): DataFrame = asColumn { it.convertToUtcOffset() } - // endregion // region toYearMonth @@ -1519,20 +1331,6 @@ public fun DataColumn.convertToYearMonth(): DataColumn Convert.toYearMonth(): DataFrame = asColumn { it.convertToYearMonth() } -/** - * Converts values in the [DateTimeComponents] columns previously selected with [convert] to [YearMonth], - * preserving their original names and positions within the [DataFrame]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * @return A new [DataFrame] with the values converted to [YearMonth]. - */ -@JvmName("toYearMonthFromDateTimeComponents") -@Refine -@Converter(YearMonth::class, nullable = false) -@Interpretable("ToSpecificType") -public fun Convert.toYearMonth(): DataFrame = asColumn { it.convertToYearMonth() } - // endregion // region toLocalDate @@ -1674,27 +1472,6 @@ public fun DataColumn.convertToLocalDate(): DataColumn Convert.toLocalDate(zone: TimeZone = defaultTimeZone): DataFrame = asColumn { it.convertToLocalDate(zone) } -/** - * Converts values in the [Long] columns previously selected with [convert] to the [LocalDate], - * preserving their original names and positions within the [DataFrame]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { timestamp }.toLocalDate() - * ``` - * - * @param zone The [TimeZone] used to interpret the [Long] timestamp as a date. Defaults to the system current time zone. - * @return A new [DataFrame] with the values converted to [LocalDate]. - */ -@JvmName("toLocalDateFromTLong") -@Refine -@Converter(LocalDate::class, nullable = false) -@Interpretable("ToSpecificTypeZone") -public fun Convert.toLocalDate(zone: TimeZone = defaultTimeZone): DataFrame = - asColumn { it.convertToLocalDate(zone) } - /** * Converts values in the [Int] columns previously selected with [convert] to the [LocalDate], * preserving their original names and positions within the [DataFrame]. @@ -1710,34 +1487,13 @@ public fun Convert.toLocalDate(zone: TimeZone = defaultTimeZone): D * @param zone The [TimeZone] used to interpret the [Int] timestamp as a date. Defaults to the system current time zone. * @return A new [DataFrame] with the values converted to [LocalDate]. */ -@JvmName("toLocalDateFromTInt") +@JvmName("toLocalDateFromTIntNullable") @Refine @Converter(LocalDate::class, nullable = true) @Interpretable("ToSpecificTypeZone") public fun Convert.toLocalDate(zone: TimeZone = defaultTimeZone): DataFrame = asColumn { it.convertToLocalDate(zone) } -/** - * Converts values in the [Int] columns previously selected with [convert] to the [LocalDate], - * preserving their original names and positions within the [DataFrame]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { timestamp }.toLocalDate() - * ``` - * - * @param zone The [TimeZone] used to interpret the [Int] timestamp as a date. Defaults to the system current time zone. - * @return A new [DataFrame] with the values converted to [LocalDate]. - */ -@JvmName("toLocalDateFromTIntNullable") -@Refine -@Converter(LocalDate::class, nullable = false) -@Interpretable("ToSpecificTypeZone") -public fun Convert.toLocalDate(zone: TimeZone = defaultTimeZone): DataFrame = - asColumn { it.convertToLocalDate(zone) } - /** * Converts values in the [String] columns previously selected with [convert] to the [LocalDate], * preserving their original names and positions within the [DataFrame]. @@ -1789,55 +1545,6 @@ public fun Convert.toLocalDate(format: DateTimeFormat public fun Convert.toLocalDate(pattern: String): DataFrame = asColumn { it.convertToLocalDate(pattern) } -/** - * Converts values in the [String] columns previously selected with [convert] to the [LocalDate], - * preserving their original names and positions within the [DataFrame]. - * - * Trims each string and attempts to parse it using the specified [format]. - * Fails with an exception if a value cannot be parsed. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { timestamp }.toLocalDate() - * ``` - * - * @param [format] An optional [DateTimeFormat] to use when parsing. If `null`, the defaults will be used. - * @return A new [DataFrame] with the values converted to [LocalDate]. - */ -@JvmName("toLocalDateFromString") -@Refine -@Converter(LocalDate::class, nullable = false) -@Interpretable("ToSpecificTypePattern") -public fun Convert.toLocalDate(format: DateTimeFormat? = null): DataFrame = - asColumn { it.convertToLocalDate(format) } - -/** - * Converts values in the [String] columns previously selected with [convert] to the [LocalDate], - * preserving their original names and positions within the [DataFrame]. - * - * Trims each string and attempts to parse it using the specified [pattern]. - * Fails with an exception if a value cannot be parsed. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { timestamp }.toLocalDate() - * ``` - * - * @param pattern An optional date pattern to use for parsing. - * @return A new [DataFrame] with the values converted to [LocalDate]. - */ -@JvmName("toLocalDateFromStringPattern") -@Refine -@Converter(LocalDate::class, nullable = false) -@Interpretable("ToSpecificTypePattern") -@FormatStringsInDatetimeFormats -public fun Convert.toLocalDate(pattern: String): DataFrame = - asColumn { it.convertToLocalDate(pattern) } - /** * Converts values in the [DateTimeComponents] columns previously selected with [convert] to the [LocalDate], * preserving their original names and positions within the [DataFrame]. @@ -1853,20 +1560,6 @@ public fun Convert.toLocalDate(pattern: String): DataFrame = @Interpretable("ToSpecificType") public fun Convert.toLocalDate(): DataFrame = asColumn { it.convertToLocalDate() } -/** - * Converts values in the [DateTimeComponents] columns previously selected with [convert] to the [LocalDate], - * preserving their original names and positions within the [DataFrame]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * @return A new [DataFrame] with the values converted to [LocalDate]. - */ -@JvmName("toLocalDateFromDateTimeComponents") -@Refine -@Converter(LocalDate::class, nullable = false) -@Interpretable("ToSpecificType") -public fun Convert.toLocalDate(): DataFrame = asColumn { it.convertToLocalDate() } - /** * Converts values in the columns previously selected with [convert] to the [LocalDate], * preserving their original names and positions within the [DataFrame]. @@ -2005,7 +1698,7 @@ public fun DataColumn.convertToLocalTime(): DataColumn.convertToLocalTime(): DataColumn = convertTo() /** - * Converts values in the [Long] columns previously selected with [convert] to the [LocalDate], + * Converts values in the [Long] columns previously selected with [convert] to the [LocalTime], * preserving their original names and positions within the [DataFrame]. * Preserves null values. * @@ -2027,28 +1720,7 @@ public fun Convert.toLocalTime(zone: TimeZone = defaultTimeZone): asColumn { it.convertToLocalTime(zone) } /** - * Converts values in the [Long] columns previously selected with [convert] to the [LocalDate], - * preserving their original names and positions within the [DataFrame]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { timestamp }.toLocalTime() - * ``` - * - * @param zone The [TimeZone] used to interpret the [Long] timestamp as a time. Defaults to the system current time zone. - * @return A new [DataFrame] with the values converted to [LocalTime]. - */ -@JvmName("toLocalTimeFromTLong") -@Refine -@Converter(LocalTime::class, nullable = false) -@Interpretable("ToSpecificTypeZone") -public fun Convert.toLocalTime(zone: TimeZone = defaultTimeZone): DataFrame = - asColumn { it.convertToLocalTime(zone) } - -/** - * Converts values in the [Int] columns previously selected with [convert] to the [LocalDate], + * Converts values in the [Int] columns previously selected with [convert] to the [LocalTime], * preserving their original names and positions within the [DataFrame]. * Preserves null values. * @@ -2069,27 +1741,6 @@ public fun Convert.toLocalTime(zone: TimeZone = defaultTimeZone): D public fun Convert.toLocalTime(zone: TimeZone = defaultTimeZone): DataFrame = asColumn { it.convertToLocalTime(zone) } -/** - * Converts values in the [Int] columns previously selected with [convert] to the [LocalDate], - * preserving their original names and positions within the [DataFrame]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { timestamp }.toLocalTime() - * ``` - * - * @param zone The [TimeZone] used to interpret the [Int] timestamp as a time. Defaults to the system current time zone. - * @return A new [DataFrame] with the values converted to [LocalTime]. - */ -@JvmName("toLocalTimeFromTInt") -@Refine -@Converter(LocalTime::class, nullable = false) -@Interpretable("ToSpecificTypeZone") -public fun Convert.toLocalTime(zone: TimeZone = defaultTimeZone): DataFrame = - asColumn { it.convertToLocalTime(zone) } - /** * Converts values in the [String] columns previously selected with [convert] to the [LocalTime], * preserving their original names and positions within the [DataFrame]. @@ -2112,62 +1763,13 @@ public fun Convert.toLocalTime(zone: TimeZone = defaultTimeZone): Da @Refine @Converter(LocalTime::class, nullable = true) @Interpretable("ToSpecificTypePattern") -public fun Convert.toLocalTime(format: DateTimeFormat? = null): DataFrame = - asColumn { it.convertToLocalTime(format) } - -/** - * Converts values in the [String] columns previously selected with [convert] to the [LocalTime], - * preserving their original names and positions within the [DataFrame]. - * Preserves null values. - * - * Trims each string and attempts to parse it using the specified [pattern]. - * Fails with an exception if a value cannot be parsed. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { timestamp }.toLocalTime() - * ``` - * - * @param pattern An optional date pattern to use for parsing. - * @return A new [DataFrame] with the values converted to [LocalTime]. - */ -@JvmName("toLocalTimeFromStringNullablePattern") -@Refine -@Converter(LocalTime::class, nullable = true) -@Interpretable("ToSpecificTypePattern") -@FormatStringsInDatetimeFormats -public fun Convert.toLocalTime(pattern: String): DataFrame = - asColumn { it.convertToLocalTime(pattern) } - -/** - * Converts values in the [String] columns previously selected with [convert] to the [LocalTime], - * preserving their original names and positions within the [DataFrame]. - * - * Trims each string and attempts to parse it using the specified [format]. - * Fails with an exception if a value cannot be parsed. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { timestamp }.toLocalTime() - * ``` - * - * @param [format] An optional [DateTimeFormat] to use when parsing. If `null`, the defaults will be used. - * @return A new [DataFrame] with the values converted to [LocalTime]. - */ -@JvmName("toLocalTimeFromString") -@Refine -@Converter(LocalTime::class, nullable = false) -@Interpretable("ToSpecificTypePattern") -public fun Convert.toLocalTime(format: DateTimeFormat? = null): DataFrame = +public fun Convert.toLocalTime(format: DateTimeFormat? = null): DataFrame = asColumn { it.convertToLocalTime(format) } /** * Converts values in the [String] columns previously selected with [convert] to the [LocalTime], * preserving their original names and positions within the [DataFrame]. + * Preserves null values. * * Trims each string and attempts to parse it using the specified [pattern]. * Fails with an exception if a value cannot be parsed. @@ -2182,12 +1784,12 @@ public fun Convert.toLocalTime(format: DateTimeFormat? * @param pattern An optional date pattern to use for parsing. * @return A new [DataFrame] with the values converted to [LocalTime]. */ -@FormatStringsInDatetimeFormats -@JvmName("toLocalTimeFromStringPattern") +@JvmName("toLocalTimeFromStringNullablePattern") @Refine -@Converter(LocalTime::class, nullable = false) +@Converter(LocalTime::class, nullable = true) @Interpretable("ToSpecificTypePattern") -public fun Convert.toLocalTime(pattern: String): DataFrame = +@FormatStringsInDatetimeFormats +public fun Convert.toLocalTime(pattern: String): DataFrame = asColumn { it.convertToLocalTime(pattern) } /** @@ -2205,20 +1807,6 @@ public fun Convert.toLocalTime(pattern: String): DataFrame = @Interpretable("ToSpecificType") public fun Convert.toLocalTime(): DataFrame = asColumn { it.convertToLocalTime() } -/** - * Converts values in the [DateTimeComponents] columns previously selected with [convert] to the [LocalTime], - * preserving their original names and positions within the [DataFrame]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * @return A new [DataFrame] with the values converted to [LocalTime]. - */ -@JvmName("toLocalTimeFromDateTimeComponents") -@Refine -@Converter(LocalTime::class, nullable = false) -@Interpretable("ToSpecificType") -public fun Convert.toLocalTime(): DataFrame = asColumn { it.convertToLocalTime() } - /** * Converts values in the columns previously selected with [convert] to the [LocalTime], * preserving their original names and positions within the [DataFrame]. @@ -2436,27 +2024,6 @@ public fun DataColumn.convertToLocalDateTime(): DataColumn< public fun Convert.toLocalDateTime(zone: TimeZone = defaultTimeZone): DataFrame = asColumn { it.convertToLocalDateTime(zone) } -/** - * Converts values in the [Long] columns previously selected with [convert] to the [LocalDateTime], - * preserving their original names and positions within the [DataFrame]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { timestamp }.toLocalDateTime() - * ``` - * - * @param zone The [TimeZone] used to interpret the [Long] timestamp as a time. Defaults to the system current time zone. - * @return A new [DataFrame] with the values converted to [LocalDateTime]. - */ -@JvmName("toLocalDateTimeFromTLong") -@Refine -@Converter(LocalDateTime::class, nullable = false) -@Interpretable("ToSpecificTypeZone") -public fun Convert.toLocalDateTime(zone: TimeZone = defaultTimeZone): DataFrame = - asColumn { it.convertToLocalDateTime(zone) } - /** * Converts values in the [kotlinx.datetime.Instant] columns previously selected with [convert] to the [LocalDateTime], * preserving their original names and positions within the [DataFrame]. @@ -2479,27 +2046,6 @@ public fun Convert.toLocalDateTime(zone: TimeZone = defaultTimeZone public fun Convert.toLocalDateTime(zone: TimeZone = defaultTimeZone): DataFrame = asColumn { it.convertToLocalDateTime(zone) } -/** - * Converts values in the [kotlinx.datetime.Instant] columns previously selected with [convert] to the [LocalDateTime], - * preserving their original names and positions within the [DataFrame]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { timestamp }.toLocalDateTime() - * ``` - * - * @param zone The [TimeZone] used to interpret the [kotlinx.datetime.Instant] timestamp as a time. Defaults to the system current time zone. - * @return A new [DataFrame] with the values converted to [LocalDateTime]. - */ -@JvmName("toLocalDateTimeFromTDeprecatedInstant") -@Refine -@Converter(LocalDateTime::class, nullable = false) -@Interpretable("ToSpecificTypeZone") -public fun Convert.toLocalDateTime(zone: TimeZone = defaultTimeZone): DataFrame = - asColumn { it.convertToLocalDateTime(zone) } - /** * Converts values in the [kotlin.time.Instant] columns previously selected with [convert] to the [LocalDateTime], * preserving their original names and positions within the [DataFrame]. @@ -2522,27 +2068,6 @@ public fun Convert.toLocalDateTime(zone: TimeZone = de public fun Convert.toLocalDateTime(zone: TimeZone = defaultTimeZone): DataFrame = asColumn { it.convertToLocalDateTime(zone) } -/** - * Converts values in the [kotlin.time.Instant] columns previously selected with [convert] to the [LocalDateTime], - * preserving their original names and positions within the [DataFrame]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { timestamp }.toLocalDateTime() - * ``` - * - * @param zone The [TimeZone] used to interpret the [kotlin.time.Instant] timestamp as a time. Defaults to the system current time zone. - * @return A new [DataFrame] with the values converted to [LocalDateTime]. - */ -@JvmName("toLocalDateTimeFromTStdlibInstant") -@Refine -@Converter(LocalDateTime::class, nullable = false) -@Interpretable("ToSpecificTypeZone") -public fun Convert.toLocalDateTime(zone: TimeZone = defaultTimeZone): DataFrame = - asColumn { it.convertToLocalDateTime(zone) } - /** * Converts values in the [Int] columns previously selected with [convert] to the [LocalDateTime], * preserving their original names and positions within the [DataFrame]. @@ -2565,27 +2090,6 @@ public fun Convert.toLocalDateTime(zone: TimeZone = defaul public fun Convert.toLocalDateTime(zone: TimeZone = defaultTimeZone): DataFrame = asColumn { it.convertToLocalDateTime(zone) } -/** - * Converts values in the [Int] columns previously selected with [convert] to the [LocalDateTime], - * preserving their original names and positions within the [DataFrame]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { timestamp }.toLocalDateTime() - * ``` - * - * @param zone The [TimeZone] used to interpret the [Int] timestamp as a time. Defaults to the system current time zone. - * @return A new [DataFrame] with the values converted to [LocalDateTime]. - */ -@JvmName("toLocalDateTimeFromTInt") -@Refine -@Converter(LocalDateTime::class, nullable = false) -@Interpretable("ToSpecificTypeZone") -public fun Convert.toLocalDateTime(zone: TimeZone = defaultTimeZone): DataFrame = - asColumn { it.convertToLocalDateTime(zone) } - /** * Converts values in the [String] columns previously selected with [convert] to the [LocalDateTime], * preserving their original names and positions within the [DataFrame]. @@ -2637,55 +2141,6 @@ public fun Convert.toLocalDateTime(format: DateTimeFormat Convert.toLocalDateTime(pattern: String): DataFrame = asColumn { it.convertToLocalDateTime(pattern) } -/** - * Converts values in the [String] columns previously selected with [convert] to the [LocalDateTime], - * preserving their original names and positions within the [DataFrame]. - * - * Trims each string and attempts to parse it using the specified [format]. - * Fails with an exception if a value cannot be parsed. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { timestamp }.toLocalTime() - * ``` - * - * @param [format] An optional [DateTimeFormat] to use when parsing. If `null`, the defaults will be used. - * @return A new [DataFrame] with the values converted to [LocalDateTime]. - */ -@JvmName("toLocalDateTimeFromString") -@Refine -@Converter(LocalDateTime::class, nullable = false) -@Interpretable("ToSpecificTypePattern") -public fun Convert.toLocalDateTime(format: DateTimeFormat? = null): DataFrame = - asColumn { it.convertToLocalDateTime(format) } - -/** - * Converts values in the [String] columns previously selected with [convert] to the [LocalDateTime], - * preserving their original names and positions within the [DataFrame]. - * - * Trims each string and attempts to parse it using the specified [pattern]. - * Fails with an exception if a value cannot be parsed. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { timestamp }.toLocalTime() - * ``` - * - * @param pattern An optional date pattern to use for parsing. - * @return A new [DataFrame] with the values converted to [LocalDateTime]. - */ -@JvmName("toLocalDateTimeFromStringPattern") -@Refine -@Converter(LocalDateTime::class, nullable = false) -@Interpretable("ToSpecificTypePattern") -@FormatStringsInDatetimeFormats -public fun Convert.toLocalDateTime(pattern: String): DataFrame = - asColumn { it.convertToLocalDateTime(pattern) } - /** * Converts values in the [DateTimeComponents] columns previously selected with [convert] to the [LocalDateTime], * preserving their original names and positions within the [DataFrame]. @@ -2702,20 +2157,6 @@ public fun Convert.toLocalDateTime(pattern: String): DataFrame public fun Convert.toLocalDateTime(): DataFrame = asColumn { it.convertToLocalDateTime() } -/** - * Converts values in the [DateTimeComponents] columns previously selected with [convert] to the [LocalDateTime], - * preserving their original names and positions within the [DataFrame]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * @return A new [DataFrame] with the values converted to [LocalDateTime]. - */ -@JvmName("toLocalDateTimeFromDateTimeComponents") -@Refine -@Converter(LocalDateTime::class, nullable = false) -@Interpretable("ToSpecificType") -public fun Convert.toLocalDateTime(): DataFrame = asColumn { it.convertToLocalDateTime() } - /** * Converts values in the columns previously selected with [convert] to the [LocalDateTime], * preserving their original names and positions within the [DataFrame]. @@ -2854,56 +2295,6 @@ public fun Convert.toDateTimeComponents( public fun Convert.toDateTimeComponents(pattern: String): DataFrame = asColumn { it.convertToDateTimeComponents(pattern) } -/** - * Converts values in the [String] columns previously selected with [convert] to the [DateTimeComponents], - * preserving their original names and positions within the [DataFrame]. - * - * Trims each string and attempts to parse it using the specified [format]. - * Fails with an exception if a value cannot be parsed. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { timestamp }.toDateTimeComponents() - * ``` - * - * @param [format] An optional [DateTimeFormat] to use when parsing. If `null`, the defaults will be used. - * @return A new [DataFrame] with the values converted to [DateTimeComponents]. - */ -@JvmName("toDateTimeComponentsFromString") -@Refine -@Converter(DateTimeComponents::class, nullable = false) -@Interpretable("ToSpecificTypePattern") -public fun Convert.toDateTimeComponents( - format: DateTimeFormat? = null, -): DataFrame = asColumn { it.convertToDateTimeComponents(format) } - -/** - * Converts values in the [String] columns previously selected with [convert] to the [DateTimeComponents], - * preserving their original names and positions within the [DataFrame]. - * - * Trims each string and attempts to parse it using the specified [pattern]. - * Fails with an exception if a value cannot be parsed. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { timestamp }.toDateTimeComponents() - * ``` - * - * @param pattern An optional date-time pattern to use for parsing. - * @return A new [DataFrame] with the values converted to [DateTimeComponents]. - */ -@JvmName("toDateTimeComponentsFromStringPattern") -@Refine -@Converter(DateTimeComponents::class, nullable = false) -@Interpretable("ToSpecificTypePattern") -@FormatStringsInDatetimeFormats -public fun Convert.toDateTimeComponents(pattern: String): DataFrame = - asColumn { it.convertToDateTimeComponents(pattern) } - /** * Converts values in the columns previously selected with [convert] to the [DateTimeComponents], * preserving their original names and positions within the [DataFrame]. @@ -2947,30 +2338,6 @@ public fun DataColumn.convertToDuration(): DataColumn = c */ public fun DataColumn.convertToDuration(): DataColumn = convertTo() -/** - * Converts values in the columns previously selected with [convert] to [Duration], - * preserving their original names and positions within the [DataFrame]. - * - * Supported source types: [String] (parsed via [Duration.parse]), - * [JavaDuration], [Long] and [Int] (interpreted as milliseconds). - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { duration }.toDuration() - * df.convert { colsOf() }.toDuration() - * df.convert { colsOf() }.toDuration() - * ``` - * - * @return A new [DataFrame] with the values converted to [Duration]. - */ -@JvmName("toDurationTAny") -@Refine -@Converter(Duration::class, nullable = false) -@Interpretable("ToSpecificType") -public fun Convert.toDuration(): DataFrame = to() - /** * Converts values in the columns previously selected with [convert] to [Duration], * preserving their original names and positions within the [DataFrame]. @@ -3020,29 +2387,6 @@ public fun DataColumn.convertToJavaInstant(): DataColumn DataColumn.convertToJavaInstant(): DataColumn = convertTo() -/** - * Converts values in the columns previously selected with [convert] to [JavaInstant], - * preserving their original names and positions within the [DataFrame]. - * - * Supported source types: [String] (parsed), [Long] and [Int] (epoch milliseconds), - * [StdlibInstant], [DeprecatedInstant], [LocalDateTime], [JavaLocalDateTime]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { timestamp }.toJavaInstant() - * df.convert { colsOf() }.toJavaInstant() - * ``` - * - * @return A new [DataFrame] with the values converted to [JavaInstant]. - */ -@JvmName("toJavaInstantTAny") -@Refine -@Converter(JavaInstant::class, nullable = false) -@Interpretable("ToSpecificType") -public fun Convert.toJavaInstant(): DataFrame = to() - /** * Converts values in the columns previously selected with [convert] to [JavaInstant], * preserving their original names and positions within the [DataFrame]. @@ -3083,33 +2427,11 @@ public fun DataColumn.convertToJavaDuration(): DataColumn DataColumn.convertToJavaDuration(): DataColumn = convertTo() - -/** - * Converts values in the columns previously selected with [convert] to [JavaDuration], - * preserving their original names and positions within the [DataFrame]. - * - * Supported source types: [String] (parsed), [Duration]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { duration }.toJavaDuration() - * df.convert { colsOf() }.toJavaDuration() - * ``` - * - * @return A new [DataFrame] with the values converted to [JavaDuration]. + * Supported source types: [String] (parsed), [Duration]. + * + * @return A new [DataColumn] with the [JavaDuration] nullable values. */ -@JvmName("toJavaDurationTAny") -@Refine -@Converter(JavaDuration::class, nullable = false) -@Interpretable("ToSpecificType") -public fun Convert.toJavaDuration(): DataFrame = to() +public fun DataColumn.convertToJavaDuration(): DataColumn = convertTo() /** * Converts values in the columns previously selected with [convert] to [JavaDuration], @@ -3250,29 +2572,6 @@ public fun DataColumn.convertToJavaLocalDate( ), ) -/** - * Converts values in the columns previously selected with [convert] to [JavaLocalDate], - * preserving their original names and positions within the [DataFrame]. - * - * Supported source types: [String] (parsed), [Long] and [Int] (epoch milliseconds), - * [LocalDate], [LocalDateTime], [JavaLocalDateTime], [StdlibInstant], [DeprecatedInstant], [JavaInstant]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { date }.toJavaLocalDate() - * df.convert { colsOf() }.toJavaLocalDate() - * ``` - * - * @return A new [DataFrame] with the values converted to [JavaLocalDate]. - */ -@JvmName("toJavaLocalDateTAny") -@Refine -@Converter(JavaLocalDate::class, nullable = false) -@Interpretable("ToSpecificType") -public fun Convert.toJavaLocalDate(): DataFrame = to() - /** * Converts values in the columns previously selected with [convert] to [JavaLocalDate], * preserving their original names and positions within the [DataFrame]. @@ -3499,29 +2798,6 @@ public fun DataColumn.convertToJavaLocalTime( ), ) -/** - * Converts values in the columns previously selected with [convert] to [JavaLocalTime], - * preserving their original names and positions within the [DataFrame]. - * - * Supported source types: [String] (parsed), [Long] and [Int] (epoch milliseconds), - * [LocalTime], [LocalDateTime], [JavaLocalDateTime], [StdlibInstant], [JavaInstant]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { time }.toJavaLocalTime() - * df.convert { colsOf() }.toJavaLocalTime() - * ``` - * - * @return A new [DataFrame] with the values converted to [JavaLocalTime]. - */ -@JvmName("toJavaLocalTimeTAny") -@Refine -@Converter(JavaLocalTime::class, nullable = false) -@Interpretable("ToSpecificType") -public fun Convert.toJavaLocalTime(): DataFrame = to() - /** * Converts values in the columns previously selected with [convert] to [JavaLocalTime], * preserving their original names and positions within the [DataFrame]. @@ -3748,29 +3024,6 @@ public fun DataColumn.convertToJavaLocalDateTime( ), ) -/** - * Converts values in the columns previously selected with [convert] to [JavaLocalDateTime], - * preserving their original names and positions within the [DataFrame]. - * - * Supported source types: [String] (parsed), [Long] and [Int] (epoch milliseconds), - * [LocalDateTime], [LocalDate], [JavaLocalDate], [StdlibInstant], [DeprecatedInstant], [JavaInstant]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { dateTime }.toJavaLocalDateTime() - * df.convert { colsOf() }.toJavaLocalDateTime() - * ``` - * - * @return A new [DataFrame] with the values converted to [JavaLocalDateTime]. - */ -@JvmName("toJavaLocalDateTimeTAny") -@Refine -@Converter(JavaLocalDateTime::class, nullable = false) -@Interpretable("ToSpecificType") -public fun Convert.toJavaLocalDateTime(): DataFrame = to() - /** * Converts values in the columns previously selected with [convert] to [JavaLocalDateTime], * preserving their original names and positions within the [DataFrame]. @@ -3794,48 +3047,6 @@ public fun Convert.toJavaLocalDateTime(): DataFrame = to Convert.toJavaLocalDateTime(): DataFrame = to() -/** - * Converts values in the [String] columns previously selected with [convert] to [JavaLocalDateTime], - * preserving their original names and positions within the [DataFrame]. - * - * Trims each string and attempts to parse it using the specified [formatter] and [locale]. - * Fails with an exception if a value cannot be parsed. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * @param formatter An optional [DateTimeFormatter] to use for parsing. If `null`, default parsers are used. - * @param locale An optional [Locale] for parsing. If `null`, the default locale is used. - * @return A new [DataFrame] with the values converted to [JavaLocalDateTime]. - */ -@JvmName("toJavaLocalDateTimeFromString") -@Refine -@Converter(JavaLocalDateTime::class, nullable = false) -@Interpretable("ToSpecificTypePattern") -public fun Convert.toJavaLocalDateTime( - formatter: DateTimeFormatter? = null, - locale: Locale? = null, -): DataFrame = asColumn { it.convertToJavaLocalDateTime(formatter, locale) } - -/** - * Converts values in the [String] columns previously selected with [convert] to [JavaLocalDateTime], - * preserving their original names and positions within the [DataFrame]. - * - * Trims each string and attempts to parse it using the specified [pattern] and [locale]. - * Fails with an exception if a value cannot be parsed. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * @param pattern A date-time pattern to use for parsing (e.g., `"yyyy-MM-dd HH:mm:ss"`). - * @param locale An optional [Locale] for parsing. If `null`, the default locale is used. - * @return A new [DataFrame] with the values converted to [JavaLocalDateTime]. - */ -@JvmName("toJavaLocalDateTimeFromStringPattern") -@Refine -@Converter(JavaLocalDateTime::class, nullable = false) -@Interpretable("ToSpecificTypePattern") -public fun Convert.toJavaLocalDateTime(pattern: String, locale: Locale? = null): DataFrame = - asColumn { it.convertToJavaLocalDateTime(pattern, locale) } - /** * Converts values in the nullable [String] columns previously selected with [convert] to [JavaLocalDateTime], * preserving their original names and positions within the [DataFrame]. @@ -3882,26 +3093,6 @@ public fun Convert.toJavaLocalDateTime(pattern: String, locale: // endregion -/** - * Converts values in the columns previously selected with [convert] to the [Int], - * preserving their original names and positions within the [DataFrame]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { age and year }.toInt() - * df.convert { colsOf() }.toInt() - * ``` - * - * @return A new [DataFrame] with the values converted to [Int]. - */ -@JvmName("toIntTAny") -@Refine -@Converter(Int::class, nullable = false) -@Interpretable("ToSpecificType") -public fun Convert.toInt(): DataFrame = to() - /** * Converts values in the columns previously selected with [convert] to the [Int], * preserving their original names and positions within the [DataFrame]. @@ -3922,26 +3113,6 @@ public fun Convert.toInt(): DataFrame = to() @Interpretable("ToSpecificType") public fun Convert.toInt(): DataFrame = to() -/** - * Converts values in the columns previously selected with [convert] to the [Long], - * preserving their original names and positions within the [DataFrame]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { age and year }.toLong() - * df.convert { colsOf() }.toLong() - * ``` - * - * @return A new [DataFrame] with the values converted to [Long]. - */ -@JvmName("toLongTAny") -@Refine -@Converter(Long::class, nullable = false) -@Interpretable("ToSpecificType") -public fun Convert.toLong(): DataFrame = to() - /** * Converts values in the columns previously selected with [convert] to the [Long], * preserving their original names and positions within the [DataFrame]. @@ -3962,26 +3133,6 @@ public fun Convert.toLong(): DataFrame = to() @Interpretable("ToSpecificType") public fun Convert.toLong(): DataFrame = to() -/** - * Converts values in the columns previously selected with [convert] to the [String], - * preserving their original names and positions within the [DataFrame]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { age and year }.toStr() - * df.convert { colsOf() }.toStr() - * ``` - * - * @return A new [DataFrame] with the values converted to [String]. - */ -@JvmName("toStrTAny") -@Refine -@Converter(String::class, nullable = false) -@Interpretable("ToSpecificType") -public fun Convert.toStr(): DataFrame = to() - /** * Converts values in the columns previously selected with [convert] to the [String], * preserving their original names and positions within the [DataFrame]. @@ -4002,26 +3153,6 @@ public fun Convert.toStr(): DataFrame = to() @Interpretable("ToSpecificType") public fun Convert.toStr(): DataFrame = to() -/** - * Converts values in the columns previously selected with [convert] to the [Double], - * preserving their original names and positions within the [DataFrame]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { age and year }.toDouble() - * df.convert { colsOf() }.toDouble() - * ``` - * - * @return A new [DataFrame] with the values converted to [Double]. - */ -@JvmName("toDoubleTAny") -@Refine -@Converter(Double::class, nullable = false) -@Interpretable("ToSpecificType") -public fun Convert.toDouble(): DataFrame = to() - /** * Converts values in the columns previously selected with [convert] to the [Double], * preserving their original names and positions within the [DataFrame]. @@ -4042,26 +3173,6 @@ public fun Convert.toDouble(): DataFrame = to() @Interpretable("ToSpecificType") public fun Convert.toDouble(): DataFrame = to() -/** - * Converts values in the columns previously selected with [convert] to the [Float], - * preserving their original names and positions within the [DataFrame]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { age and year }.toFloat() - * df.convert { colsOf() }.toFloat() - * ``` - * - * @return A new [DataFrame] with the values converted to [Float]. - */ -@JvmName("toFloatTAny") -@Refine -@Converter(Float::class, nullable = false) -@Interpretable("ToSpecificType") -public fun Convert.toFloat(): DataFrame = to() - /** * Converts values in the columns previously selected with [convert] to the [Float], * preserving their original names and positions within the [DataFrame]. @@ -4082,26 +3193,6 @@ public fun Convert.toFloat(): DataFrame = to() @Interpretable("ToSpecificType") public fun Convert.toFloat(): DataFrame = to() -/** - * Converts values in the columns previously selected with [convert] to the [BigDecimal], - * preserving their original names and positions within the [DataFrame]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { age and year }.toBigDecimal() - * df.convert { colsOf() }.toBigDecimal() - * ``` - * - * @return A new [DataFrame] with the values converted to [BigDecimal]. - */ -@JvmName("toBigDecimalTAny") -@Refine -@Converter(BigDecimal::class, nullable = false) -@Interpretable("ToSpecificType") -public fun Convert.toBigDecimal(): DataFrame = to() - /** * Converts values in the columns previously selected with [convert] to the [BigDecimal], * preserving their original names and positions within the [DataFrame]. @@ -4122,26 +3213,6 @@ public fun Convert.toBigDecimal(): DataFrame = to() @Interpretable("ToSpecificType") public fun Convert.toBigDecimal(): DataFrame = to() -/** - * Converts values in the columns previously selected with [convert] to the [BigInteger], - * preserving their original names and positions within the [DataFrame]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { age and year }.toBigInteger() - * df.convert { colsOf() }.toBigInteger() - * ``` - * - * @return A new [DataFrame] with the values converted to [BigInteger]. - */ -@JvmName("toBigIntegerTAny") -@Refine -@Converter(BigInteger::class, nullable = false) -@Interpretable("ToSpecificType") -public fun Convert.toBigInteger(): DataFrame = to() - /** * Converts values in the columns previously selected with [convert] to the [BigInteger], * preserving their original names and positions within the [DataFrame]. @@ -4162,26 +3233,6 @@ public fun Convert.toBigInteger(): DataFrame = to() @Interpretable("ToSpecificType") public fun Convert.toBigInteger(): DataFrame = to() -/** - * Converts values in the columns previously selected with [convert] to the [Boolean], - * preserving their original names and positions within the [DataFrame]. - * - * For more information: {@include [DocumentationUrls.Convert]} - * - * ### Examples: - * ```kotlin - * df.convert { isMarked and isFinished }.toBoolean() - * df.convert { colsOf { it.name.startsWith("it") } }.toBoolean() - * ``` - * - * @return A new [DataFrame] with the values converted to [Boolean]. - */ -@JvmName("toBooleanTAny") -@Refine -@Converter(Boolean::class, nullable = false) -@Interpretable("ToSpecificType") -public fun Convert.toBoolean(): DataFrame = to() - /** * Converts values in the columns previously selected with [convert] to the [Boolean], * preserving their original names and positions within the [DataFrame]. @@ -4253,16 +3304,6 @@ public fun Convert.toLocalDate(pattern: String? = null, locale: toJavaLocalDate(formatter = pattern?.let { DateTimeFormatter.ofPattern(pattern) }, locale = locale) .convert(this.columns).toLocalDate() -@Deprecated( - message = CONVERT_TO_KOTLIN_DATETIME_LOCALE, - replaceWith = ReplaceWith("this.toJavaLocalDate(pattern, locale)"), - level = DeprecationLevel.ERROR, -) -@JvmName("toLocalDateFromString") -public fun Convert.toLocalDate(pattern: String? = null, locale: Locale?): DataFrame = - toJavaLocalDate(formatter = pattern?.let { DateTimeFormatter.ofPattern(pattern) }, locale = locale) - .convert(this.columns).toLocalDate() - @Deprecated( message = CONVERT_TO_KOTLIN_DATETIME_LOCALE, replaceWith = ReplaceWith("this.toJavaLocalTime(pattern, locale)"), @@ -4273,16 +3314,6 @@ public fun Convert.toLocalTime(pattern: String? = null, locale: toJavaLocalTime(formatter = pattern?.let { DateTimeFormatter.ofPattern(pattern) }, locale = locale) .convert(this.columns).toLocalTime() -@Deprecated( - message = CONVERT_TO_KOTLIN_DATETIME_LOCALE, - replaceWith = ReplaceWith("this.toJavaLocalTime(pattern, locale)"), - level = DeprecationLevel.ERROR, -) -@JvmName("toLocalTimeFromString") -public fun Convert.toLocalTime(pattern: String? = null, locale: Locale?): DataFrame = - toJavaLocalTime(formatter = pattern?.let { DateTimeFormatter.ofPattern(pattern) }, locale = locale) - .convert(this.columns).toLocalTime() - @Deprecated( message = CONVERT_TO_KOTLIN_DATETIME_LOCALE, replaceWith = ReplaceWith("this.toJavaLocalDateTime(pattern, locale)"), @@ -4293,16 +3324,6 @@ public fun Convert.toLocalDateTime(pattern: String? = null, loca toJavaLocalDateTime(formatter = pattern?.let { DateTimeFormatter.ofPattern(pattern) }, locale = locale) .convert(this.columns).toLocalDateTime() -@Deprecated( - message = CONVERT_TO_KOTLIN_DATETIME_LOCALE, - replaceWith = ReplaceWith("this.toJavaLocalDateTime(pattern, locale)"), - level = DeprecationLevel.ERROR, -) -@JvmName("toLocalDateTimeFromString") -public fun Convert.toLocalDateTime(pattern: String? = null, locale: Locale?): DataFrame = - toJavaLocalDateTime(formatter = pattern?.let { DateTimeFormatter.ofPattern(pattern) }, locale = locale) - .convert(this.columns).toLocalDateTime() - @Deprecated( message = CONVERT_TO_KOTLIN_DATETIME_LOCALE, replaceWith = ReplaceWith("this.convertToJavaLocalDate(pattern, locale).convertToLocalDate()"), diff --git a/samples/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api/Convert.kt b/samples/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api/Convert.kt new file mode 100644 index 0000000000..c876a7479e --- /dev/null +++ b/samples/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api/Convert.kt @@ -0,0 +1,687 @@ +@file:Suppress("DEPRECATION", "DEPRECATION_ERROR") + +package org.jetbrains.kotlinx.dataframe.samples.api + +import io.kotest.matchers.shouldBe +import kotlinx.datetime.LocalDate +import kotlinx.datetime.LocalDateTime +import kotlinx.datetime.LocalTime +import kotlinx.datetime.UtcOffset +import kotlinx.datetime.YearMonth +import kotlinx.datetime.format.DateTimeComponents +import kotlinx.datetime.format.FormatStringsInDatetimeFormats +import org.jetbrains.kotlinx.dataframe.DataFrame +import org.jetbrains.kotlinx.dataframe.api.columnOf +import org.jetbrains.kotlinx.dataframe.api.compileTimeSchema +import org.jetbrains.kotlinx.dataframe.api.convert +import org.jetbrains.kotlinx.dataframe.api.dataFrameOf +import org.jetbrains.kotlinx.dataframe.api.schema +import org.jetbrains.kotlinx.dataframe.api.toBigDecimal +import org.jetbrains.kotlinx.dataframe.api.toBigInteger +import org.jetbrains.kotlinx.dataframe.api.toBoolean +import org.jetbrains.kotlinx.dataframe.api.toDateTimeComponents +import org.jetbrains.kotlinx.dataframe.api.toDeprecatedInstant +import org.jetbrains.kotlinx.dataframe.api.toDouble +import org.jetbrains.kotlinx.dataframe.api.toDuration +import org.jetbrains.kotlinx.dataframe.api.toFloat +import org.jetbrains.kotlinx.dataframe.api.toIFrame +import org.jetbrains.kotlinx.dataframe.api.toImg +import org.jetbrains.kotlinx.dataframe.api.toInstant +import org.jetbrains.kotlinx.dataframe.api.toInt +import org.jetbrains.kotlinx.dataframe.api.toJavaDuration +import org.jetbrains.kotlinx.dataframe.api.toJavaInstant +import org.jetbrains.kotlinx.dataframe.api.toJavaLocalDate +import org.jetbrains.kotlinx.dataframe.api.toJavaLocalDateTime +import org.jetbrains.kotlinx.dataframe.api.toJavaLocalTime +import org.jetbrains.kotlinx.dataframe.api.toLocalDate +import org.jetbrains.kotlinx.dataframe.api.toLocalDateTime +import org.jetbrains.kotlinx.dataframe.api.toLocalTime +import org.jetbrains.kotlinx.dataframe.api.toLong +import org.jetbrains.kotlinx.dataframe.api.toStdlibInstant +import org.jetbrains.kotlinx.dataframe.api.toStr +import org.jetbrains.kotlinx.dataframe.api.toURL +import org.jetbrains.kotlinx.dataframe.api.toUrl +import org.jetbrains.kotlinx.dataframe.api.toUtcOffset +import org.jetbrains.kotlinx.dataframe.api.toYearMonth +import org.jetbrains.kotlinx.dataframe.dataTypes.IFRAME +import org.jetbrains.kotlinx.dataframe.dataTypes.IMG +import org.jetbrains.kotlinx.dataframe.impl.schema.DataFrameSchemaImpl +import org.jetbrains.kotlinx.dataframe.schema.ColumnSchema +import org.junit.Test +import java.math.BigDecimal +import java.math.BigInteger +import java.net.URL +import kotlin.reflect.KType +import kotlin.reflect.full.withNullability +import kotlin.reflect.typeOf +import kotlin.time.Duration +import kotlin.time.Instant + +class Convert { + @Test + fun `convert to IFrame preserves nullability of the column type`() { + val df = dataFrameOf( + "a" to columnOf(URL("https://kotlinlang.org"), URL("https://kotlinlang.org")), + "b" to columnOf(URL("https://github.com/Kotlin/dataframe"), null), + ) + + val converted = df.convert { a and b }.toIFrame() + + assertNullabilityPreserved(converted, typeOf