Kotlin / Kotlin/dataframe

Define missing DataRow accessors aligned with Columns Selection DSL

Open
#553 0 comments 0 reactions 1 assignee Claimed by @zaleslaw View on GitHub
API enhancement research
Dominant language
Kotlin
Stars
1.1k
Forks
83
Avg merge
4d 12h
Merged PRs (30d)
30

Description

### Title

Define missing DataRow accessors aligned with Columns Selection DSL

### Problem

`DataRow` / row-expression APIs are less consistent and less discoverable than the Columns Selection DSL.

In particular, users can reference columns in the Columns Selection DSL with concise helpers, but similar patterns are missing or unclear for row expressions.

Example candidates:

- `"column"()` to access an `Any?` value
- `"path"["to"]["column"].get()` for nested column paths

### Expected

Define a small, concrete set of DataRow accessors that should be aligned with the Columns Selection DSL.

### Acceptance criteria

- Identify which Columns Selection DSL access patterns should exist for `DataRow`
- Decide exact API shape for:
- untyped string access
- typed string access
- nested path access
- Add implementation only for the agreed subset
- Add examples/tests for the supported access patterns
- Document the relation between Columns Selection DSL and Row Expression APIs

### Motivation

Row expressions are used in core operations like `filter`, `add`, `convert`, and `update`.

If row access differs too much from column selection, users have to learn two similar but inconsistent APIs. Aligning the minimal common access patterns before 1.0 improves API consistency and avoids harder post-release changes.

Initial comment from @Jolanrensen
```
There are a lot of parallels between the Column(s) Selection DSL and Row(Value)Expressions as both allow you to reference columns. The difference being that referencing a column on a DataRow produces a value as in the Column(s) Selection DSL it produces a column.

Still, it's worth revisiting [DataRow.kt](https://github.com/Kotlin/dataframe/blob/master/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/DataRow.kt) keeping in mind the parallels with the improved Columns Selection DSL ([after that's done](https://github.com/Kotlin/dataframe/pull/372)).

One thing that comes to mind is being able to call `"column"()` without a type to reference an `Any?` column and the `"easy"["creation"]["of"]["columnPaths"].get("withSingleColumnAccess")`.
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.