Skip to content

Commit daef5cb

Browse files
committed
updated parse documentation
1 parent 18dbbbf commit daef5cb

File tree

3 files changed

+19
-15
lines changed
  • core
    • generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api
    • src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api
  • docs/StardustDocs/topics

3 files changed

+19
-15
lines changed

core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/parse.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,10 @@ internal object Parsers : GlobalParserOptions {
248248
parser
249249
},
250250

251-
// kotlin.time.duration
251+
// kotlin.time.Duration
252252
stringParser { catchSilent { Duration.parse(it) } },
253253

254-
// java.time.duration
254+
// java.time.Duration
255255
stringParser { catchSilent { java.time.Duration.parse(it) } },
256256

257257
// java.time.LocalTime

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,10 @@ internal object Parsers : GlobalParserOptions {
248248
parser
249249
},
250250

251-
// kotlin.time.duration
251+
// kotlin.time.Duration
252252
stringParser { catchSilent { Duration.parse(it) } },
253253

254-
// java.time.duration
254+
// java.time.Duration
255255
stringParser { catchSilent { java.time.Duration.parse(it) } },
256256

257257
// java.time.LocalTime

docs/StardustDocs/topics/parse.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[//]: # (title: parse)
22
<!---IMPORT org.jetbrains.kotlinx.dataframe.samples.api.Modify-->
33

4-
Returns [`DataFrame`](DataFrame.md) in which given `String` columns are parsed into other types.
4+
Returns a [`DataFrame`](DataFrame.md) in which the given `String` columns are parsed into other types.
55

6-
Special case of [convert](convert.md) operation.
6+
This is a special case of the [convert](convert.md) operation.
77

88
<!---FUN parseAll-->
99

@@ -14,7 +14,7 @@ df.parse()
1414
<dataFrame src="org.jetbrains.kotlinx.dataframe.samples.api.Modify.parseAll.html"/>
1515
<!---END-->
1616

17-
To parse only particular columns use [column selector](ColumnSelectors.md):
17+
To parse only particular columns use a [column selector](ColumnSelectors.md):
1818

1919
<!---FUN parseSome-->
2020

@@ -25,19 +25,22 @@ df.parse { age and weight }
2525
<dataFrame src="org.jetbrains.kotlinx.dataframe.samples.api.Modify.parseSome.html"/>
2626
<!---END-->
2727

28-
`parse` tries to parse every`String` column into one of supported types in the following order:
28+
`parse` tries to parse every `String` column into one of supported types in the following order:
2929
* `Int`
3030
* `Long`
31-
* `LocalDateTime`
32-
* `LocalDate`
33-
* `LocalTime`
34-
* `URL`
35-
* `Double`
31+
* `Instant` (`kotlinx.datetime` and `java.time`)
32+
* `LocalDateTime` (`kotlinx.datetime` and `java.time`)
33+
* `LocalDate` (`kotlinx.datetime` and `java.time`)
34+
* `Duration` (`kotlin.time` and `java.time`)
35+
* `LocalTime` (`java.time`)
36+
* `URL` (`java.net`)
37+
* `Double` (with optional locale settings)
3638
* `Boolean`
3739
* `BigDecimal`
40+
* `JSON` (arrays and objects)
3841

3942
Available parser options:
40-
* `locale: Locale` is used to parse numbers
43+
* `locale: Locale` is used to parse doubles
4144
* `dateTimePattern: String` is used to parse date and time
4245
* `dateTimeFormatter: DateTimeFormatter` is used to parse date and time
4346
* `nullStrings: List<String>` 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
5154
<dataFrame src="org.jetbrains.kotlinx.dataframe.samples.api.Modify.parseWithOptions.html"/>
5255
<!---END-->
5356

54-
You can also set global parser options that will be used by default in [`read`](read.md), [`convert`](convert.md) and `parse` operations:
57+
You can also set global parser options that will be used by default in [`read`](read.md), [`convert`](convert.md),
58+
and `parse` operations:
5559

5660
<!---FUN globalParserOptions-->
5761

0 commit comments

Comments
 (0)