Skip to content

Commit d800fde

Browse files
committed
updating some notes based on feedback
1 parent 49ca4aa commit d800fde

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,8 @@ allprojects {
191191
}
192192
tasks.withType<KotlinCompile> {
193193
compilerOptions {
194-
// enables support for kotlin.time.Instant as kotlinx.datetime.Instant was deprecated
194+
// enables support for kotlin.time.Instant as kotlinx.datetime.Instant was deprecated; Issue #1350
195+
// Can be removed once kotlin.time.Instant is marked "stable".
195196
optIn.add("kotlin.time.ExperimentalTime")
196197
}
197198
}

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ internal fun createConverter(from: KType, to: KType, options: ParserOptions? = n
399399

400400
StdlibInstant::class -> convert<Int> { StdlibInstant.fromEpochMilliseconds(it.toLong()) }
401401

402-
// #1350
402+
// Related to migration of kotlinx.datetime.Instant -> kotlin.time.Instant, Issue #1350
403403
DeprecatedInstant::class -> convert<Int> { DeprecatedInstant.fromEpochMilliseconds(it.toLong()) }
404404

405405
JavaLocalDateTime::class -> convert<Int> {
@@ -440,7 +440,7 @@ internal fun createConverter(from: KType, to: KType, options: ParserOptions? = n
440440

441441
StdlibInstant::class -> convert<Byte> { StdlibInstant.fromEpochMilliseconds(it.toLong()) }
442442

443-
// #1350
443+
// Related to migration of kotlinx.datetime.Instant -> kotlin.time.Instant, Issue #1350
444444
DeprecatedInstant::class -> convert<Byte> { DeprecatedInstant.fromEpochMilliseconds(it.toLong()) }
445445

446446
JavaLocalDateTime::class -> convert<Byte> {
@@ -481,7 +481,7 @@ internal fun createConverter(from: KType, to: KType, options: ParserOptions? = n
481481

482482
StdlibInstant::class -> convert<Short> { StdlibInstant.fromEpochMilliseconds(it.toLong()) }
483483

484-
// #1350
484+
// Related to migration of kotlinx.datetime.Instant -> kotlin.time.Instant, Issue #1350
485485
DeprecatedInstant::class -> convert<Short> { DeprecatedInstant.fromEpochMilliseconds(it.toLong()) }
486486

487487
JavaLocalDateTime::class -> convert<Short> {
@@ -534,7 +534,7 @@ internal fun createConverter(from: KType, to: KType, options: ParserOptions? = n
534534

535535
StdlibInstant::class -> convert<Long> { StdlibInstant.fromEpochMilliseconds(it) }
536536

537-
// #1350
537+
// Related to migration of kotlinx.datetime.Instant -> kotlin.time.Instant, Issue #1350
538538
DeprecatedInstant::class -> convert<Long> { DeprecatedInstant.fromEpochMilliseconds(it) }
539539

540540
JavaLocalDateTime::class -> convert<Long> {
@@ -569,13 +569,13 @@ internal fun createConverter(from: KType, to: KType, options: ParserOptions? = n
569569

570570
JavaLocalTime::class -> convert<StdlibInstant> { it.toLocalTime(defaultTimeZone).toJavaLocalTime() }
571571

572-
// #1350
572+
// Related to migration of kotlinx.datetime.Instant -> kotlin.time.Instant, Issue #1350
573573
DeprecatedInstant::class -> convert<StdlibInstant> { it.toDeprecatedInstant() }
574574

575575
else -> null
576576
}
577577

578-
// #1350
578+
// Related to migration of kotlinx.datetime.Instant -> kotlin.time.Instant, Issue #1350
579579
DeprecatedInstant::class -> when (toClass) {
580580
Long::class -> convert<DeprecatedInstant> { it.toStdlibInstant().toEpochMilliseconds() }
581581

@@ -631,7 +631,7 @@ internal fun createConverter(from: KType, to: KType, options: ParserOptions? = n
631631
it.toKotlinInstant().toLocalTime(defaultTimeZone).toJavaLocalTime()
632632
}
633633

634-
// #1350
634+
// Related to migration of kotlinx.datetime.Instant -> kotlin.time.Instant, Issue #1350
635635
DeprecatedInstant::class -> convert<JavaInstant> {
636636
it.toKotlinInstant().toDeprecatedInstant()
637637
}
@@ -682,7 +682,7 @@ internal fun createConverter(from: KType, to: KType, options: ParserOptions? = n
682682

683683
StdlibInstant::class -> convert<LocalDateTime> { it.toInstant(defaultTimeZone) }
684684

685-
// #1350
685+
// Related to migration of kotlinx.datetime.Instant -> kotlin.time.Instant, Issue #1350
686686
DeprecatedInstant::class -> convert<LocalDateTime> {
687687
it.toInstant(defaultTimeZone).toDeprecatedInstant()
688688
}
@@ -711,7 +711,7 @@ internal fun createConverter(from: KType, to: KType, options: ParserOptions? = n
711711
it.toKotlinLocalDateTime().toInstant(defaultTimeZone)
712712
}
713713

714-
// #1350
714+
// Related to migration of kotlinx.datetime.Instant -> kotlin.time.Instant, Issue #1350
715715
DeprecatedInstant::class -> convert<JavaLocalDateTime> {
716716
it.toKotlinLocalDateTime().toInstant(defaultTimeZone).toDeprecatedInstant()
717717
}
@@ -736,7 +736,7 @@ internal fun createConverter(from: KType, to: KType, options: ParserOptions? = n
736736

737737
StdlibInstant::class -> convert<LocalDate> { it.atStartOfDayIn(defaultTimeZone) }
738738

739-
// #1350
739+
// Related to migration of kotlinx.datetime.Instant -> kotlin.time.Instant, Issue #1350
740740
DeprecatedInstant::class -> convert<LocalDate> {
741741
it.atStartOfDayIn(defaultTimeZone).toDeprecatedInstant()
742742
}
@@ -761,7 +761,7 @@ internal fun createConverter(from: KType, to: KType, options: ParserOptions? = n
761761
it.toKotlinLocalDate().atStartOfDayIn(defaultTimeZone)
762762
}
763763

764-
// #1350
764+
// Related to migration of kotlinx.datetime.Instant -> kotlin.time.Instant, Issue #1350
765765
DeprecatedInstant::class -> convert<JavaLocalDate> {
766766
it.toKotlinLocalDate().atStartOfDayIn(defaultTimeZone).toDeprecatedInstant()
767767
}

docs/StardustDocs/topics/parse.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ df.parse { age and weight }
3636
`parse` tries to parse every `String` column into one of supported types in the following order:
3737
* `Int`
3838
* `Long`
39-
* `Instant` (`kotlin.time`) (requires `parseExperimentalInstant = true`)
39+
* `Instant` (`kotlin.time`) (requires `parseExperimentalInstant = true`, available from Kotlin 2.1+.)
4040
* `Instant` (`kotlinx.datetime` and `java.time`)
4141
* `LocalDateTime` (`kotlinx.datetime` and `java.time`)
4242
* `LocalDate` (`kotlinx.datetime` and `java.time`)
@@ -76,7 +76,7 @@ Available parser options:
7676
* `parseExperimentalUuid: Boolean` is used to enable or disable parsing to the experimental [`kotlin.uuid.Uuid` class](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.uuid/-uuid/).
7777
* Disabled by global default
7878
* `parseExperimentalInstant: Boolean` is used to enable or disable parsing to the experimental
79-
[`kotlin.time.Instant` class](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.time/-instant/).
79+
[`kotlin.time.Instant` class](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.time/-instant/), available from Kotlin 2.1+. Will parse to `kotlinx.datetime.Instant` if `false`.
8080
* Disabled by global default
8181

8282
<!---FUN parseWithOptions-->

0 commit comments

Comments
 (0)