Conversation
696323a to
6e06b95
Compare
Edit: slightly outdated |
ff402cd to
f301693
Compare
6802cbb to
8e045f0
Compare
0b7359d to
d172cff
Compare
- removed `coveredBy` as it was barely used anymore and generally confusing. Parsers can now return SKIP_PARSER to get skipped.
- parseBy {} shortcut function
- Parsers can now have a `name` which makes debugging a lot easier
- parsers can have fallbackParserForConverter, you'll see in the next commits why this is useful
…s as converter logic, taking multiple parsers into account, running them all in order with their fallback mechanisms.
- global dateTimeLibrary setting, allowing skipping all java- or kotlin types - global/default date-time formats are now typed and stored in a LazyMap. New ones can be provided as DateTimeFormat(ter) or pattern. - parsing order is now: - if parserOptions.dateTime has custom formats, run those, skip all the others - run custom global kotlin/java date-time parsers - run default ones - when converting String -> kotlinx datetime, we have a String -> DateTimeComponents -> kotlinx datetime fallback now. - Locale is now always applied to java date-time if provided by the user - We can now parse to Month and DayOfWeek
New parser date-time API! - DateTimeParserOptions.Java/Kotlin - Updated date-time functions in GlobalParserOptions - Deprecated old overloads - updated tests and samples - See new KDocs for more information
…interesting case, because Duration is a value class)
…we cannot always know the source column is a String column.
…ents with workarounds
- Extra convert duration overloads - Extra convert instant overloads - Extra convert overloads from DateTimeComponents to all possible targets - new convertTo kotlin date-time functions with pattern/format arguments. - new convertTo java date-time functions with (pattern/formatter)+locale arguments - tests
d172cff to
c490782
Compare
| internal fun AnyCol.convertToTypeImpl(to: KType, parserOptions: ParserOptions?): AnyCol { | ||
| val from = type | ||
|
|
||
| if (parserOptions != null && from.withNullability(false) != typeOf<String>()) { |
There was a problem hiding this comment.
I probably should remove this check... It would make:
df.convert { javaDateCol and stringCol }.to<LocalDate>(parserOptions)crash
Fixes #876
Changes parsing behavior for kotlin and java date-time, allowing both to be parsed in a more explicit and predictable way.
API changes:
ParserOptionshas changed and gainedDateTimeParserOptions.GlobalParserOptionshave also changed.col.convertTo<>()/df.convert {}.to<>()can now always takeParserOptions, and we gained a handful of new shortcuts and ones that had java arguments but returned kotlin types were deprecated.See new kdocs and commit messages for specifics :)
Needs to be followed up by #1798