Kotlin / Kotlin/dataframe

Allow custom Parsers

Open
#962 3 comments 0 reactions 0 assignees View on GitHub
enhancement files
Dominant language
Kotlin
Stars
1.1k
Forks
83
Avg merge
4d 12h
Merged PRs (30d)
30

Description

Allowing users to set custom parsers would be very helpful. It could allow them things like:

```kt
class User(val name: String, val age: Int) {
override fun toString() = "user-$name-$age"
}

DataFrame.parser.addCustomParser {
if (it.startsWith("user")) {
val (_, name, age) = it.split("-")
User(name, age)
} else null
}

DataFrame.readCsv(myCustomUserData)
```

or we could even add an enum-specific variant. This can only be done with `convert` at the moment. It could allow immediate parsing of CSV -> enum for instance.

Contributor guide

Open the contributing guide

Research direction

The issue names DataFrame.parser.addCustomParser and DataFrame.readCsv, but no files or tests. Start by tracing those entry points and the existing convert behavior. Done should allow custom User and enum values to be parsed directly from CSV without a separate convert step.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.