GlobalParserOptions
Global counterpart of ParserOptions.
These options are used to configure how DataColumns of type String or String? should be parsed.
Settings changed here will affect the defaults for all parsing operations. You can always pass a ParserOptions object to functions that perform parsing, like tryParse, parse, convert, or even DataFrame.Companion.readCsv to override these options.
The default values are set by Parsers.resetToDefault.
Parsing date-time strings
DataFrame tries parsing date-time strings using
Custom global Kotlin-, and Java date-time formats, if provided;
Default Kotlin-, and Java ISO date-time formats.
You can customize this behavior by:
Forcing one or the other date-time format type by changing
dateTimeLibrary;Providing custom date-time formats/formatters and/or custom date-time patterns (
addDateTimeFormat,addDateTimeUnicodePattern,addJavaDateTimeFormatter,addJavaDateTimePattern);Resetting to default formats;
Finally, if a parsing function is provided with ParserOptions and ParserOptions.dateTime is not null, the global dateTimeLibrary parser option will be overridden.
Concretely, ParserOptions(dateTime = DateTimeParserOptions.Java) is equivalent to having DataFrame.parser.dateTimeLibrary = ParseDateTimeLibrary.JAVA for that particular function call.
In addition, if that DateTimeParserOptions has any custom formats or patterns, the custom- and default global formats will be ignored, allowing you to essentially override them.
For more information: See Global Parser Options on the documentation website.
Inheritors
Properties
Provides an overview of all types DataFrame can parse to. This cannot be adjusted yet (#962).
DataFrame supports parsing to either kotlin(x)-datetime or java.time types.
The Locale to use for parsing numbers (and Java date-time types), defaults to the System default locale. This can be overridden by passing a custom ParserOptions to the parsing function call.
Whether to allow parsing to the kotlin.time.Instant type. This is marked "stable" from Kotlin 2.3.0+, so, by default this is true.
Whether to allow parsing UUIDs to the Uuid type. This is marked "stable" from Kotlin 2.4.0+, so, by default this is true.
Types in this set will be skipped during parsing. Parsing will be attempted for all other types.
Whether to use FastDoubleParser, defaults to true. Please report any issues you encounter. This can be overridden by passing a custom ParserOptions to the parsing function call.
Functions
Adds format to the global parser options of DataFrame.
Adds format to the global parser options of DataFrame.
Deprecated:
Adds a Unicode date-time pattern to the global parser options of DataFrame.
Adds a Unicode date-time pattern to the global parser options of DataFrame.
Adds a Java-based date-time formatter to the global parser options of DataFrame.
Adds a Java-based date-time formatter to the global parser options of DataFrame.
Adds a Java-based date-time pattern to the global parser options of DataFrame.
Adds a Java-based date-time pattern to the global parser options of DataFrame.
Adds str to the collection of Strings that will be parsed to null.
This function can be called to skip some types. Parsing will be attempted for all other types.
Resets the global parser options.