diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/parse.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/parse.kt index 0e09bb20b7..3c67a4cf62 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/parse.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/parse.kt @@ -248,10 +248,10 @@ internal object Parsers : GlobalParserOptions { parser }, - // kotlin.time.duration + // kotlin.time.Duration stringParser { catchSilent { Duration.parse(it) } }, - // java.time.duration + // java.time.Duration stringParser { catchSilent { java.time.Duration.parse(it) } }, // java.time.LocalTime diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/parse.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/parse.kt index 0e09bb20b7..3c67a4cf62 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/parse.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/parse.kt @@ -248,10 +248,10 @@ internal object Parsers : GlobalParserOptions { parser }, - // kotlin.time.duration + // kotlin.time.Duration stringParser { catchSilent { Duration.parse(it) } }, - // java.time.duration + // java.time.Duration stringParser { catchSilent { java.time.Duration.parse(it) } }, // java.time.LocalTime diff --git a/docs/StardustDocs/topics/parse.md b/docs/StardustDocs/topics/parse.md index 070084c960..a8dbd5806e 100644 --- a/docs/StardustDocs/topics/parse.md +++ b/docs/StardustDocs/topics/parse.md @@ -1,9 +1,9 @@ [//]: # (title: parse) -Returns [`DataFrame`](DataFrame.md) in which given `String` columns are parsed into other types. +Returns a [`DataFrame`](DataFrame.md) in which the given `String` columns are parsed into other types. -Special case of [convert](convert.md) operation. +This is a special case of the [convert](convert.md) operation. @@ -14,7 +14,7 @@ df.parse() -To parse only particular columns use [column selector](ColumnSelectors.md): +To parse only particular columns use a [column selector](ColumnSelectors.md): @@ -25,19 +25,22 @@ df.parse { age and weight } -`parse` tries to parse every`String` column into one of supported types in the following order: +`parse` tries to parse every `String` column into one of supported types in the following order: * `Int` * `Long` -* `LocalDateTime` -* `LocalDate` -* `LocalTime` -* `URL` -* `Double` +* `Instant` (`kotlinx.datetime` and `java.time`) +* `LocalDateTime` (`kotlinx.datetime` and `java.time`) +* `LocalDate` (`kotlinx.datetime` and `java.time`) +* `Duration` (`kotlin.time` and `java.time`) +* `LocalTime` (`java.time`) +* `URL` (`java.net`) +* `Double` (with optional locale settings) * `Boolean` * `BigDecimal` +* `JSON` (arrays and objects) Available parser options: -* `locale: Locale` is used to parse numbers +* `locale: Locale` is used to parse doubles * `dateTimePattern: String` is used to parse date and time * `dateTimeFormatter: DateTimeFormatter` is used to parse date and time * `nullStrings: List` is used to treat particular strings as `null` value. Default null strings are **"null"** and **"NULL"** @@ -51,7 +54,8 @@ df.parse(options = ParserOptions(locale = Locale.CHINA, dateTimeFormatter = Date -You can also set global parser options that will be used by default in [`read`](read.md), [`convert`](convert.md) and `parse` operations: +You can also set global parser options that will be used by default in [`read`](read.md), [`convert`](convert.md), +and `parse` operations: