Kotlin / Kotlin/dataframe

Add KDocs for non-deprecated `toDataFrame` / `toDataFrameFromPairs` APIs

Open
#1,987 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

KDocs
Dominant language
Kotlin
Stars
1.1k
Forks
83
Avg merge
4d 12h
Merged PRs (30d)
30

Description

Add KDocs for non-deprecated toDataFrame / toDataFrameFromPairs APIs

The file core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/toDataFrame.kt holds the public toDataFrame / toDataFrameFromPairs conversion APIs and their supporting DSL. It contains many overloads; almost none are documented (only List<List<T>>.toDataFrame(header, containsColumns) and a few TraversePropertiesDsl members have KDocs).

Please add concise KDocs for the current non-deprecated APIs only. Deprecated and binary-compatibility (@AccessApiOverload) overloads are out of scope.

Scope — main semantic blocks
  • From objects (reflection-based)Iterable<T>.toDataFrame() and its variants (the CreateDataFrameDsl body overload, the vararg props / maxDepth overload, and the single-columnName overload). These turn each object into a row by reading its properties.
  • From rows / columns / mapsIterable<DataRow>, Iterable<BaseColumn>, Iterable<Map<String, Any?>>, and the Map<String, Iterable> / Map<ColumnPath, Iterable> overloads.
  • From pairs (toDataFrameFromPairs) — the ColumnPath/String → column/values overloads that build (possibly nested) column groups from path→column pairs.
  • From lists of listsList<List<T>>.toDataFrame(header, containsColumns) (already documented; keep/align).
  • The building DSL — the CreateDataFrameDsl class and its members (add, expr, into, from, inferType, String.invoke, properties), the TraversePropertiesDsl (exclude / preserve, partly documented already), and the ValueProperty schema interface.
KDocs should explain
  • At the block level, what the conversion produces: how source elements map to rows vs columns, and how nested structures become column groups (especially for the property-reflection and toDataFrameFromPairs blocks).
  • For the reflection block: that columns are derived from properties, the meaning of maxDepth (recursion depth for nested objects) and props (explicit property roots), and how the CreateDataFrameDsl lets users add/rename/compute columns.
  • For TraversePropertiesDsl: exclude (skip classes/properties during traversal) and preserve (keep a type as a ValueColumn instead of expanding it) — extend the existing short KDocs into full ones.
  • For toDataFrameFromPairs: how column paths with size > 1 are grouped into nested ColumnGroups, and that duplicate top-level names are made unique.
  • Column name generation / uniqueness and type inference (createByInference / createColumnGuessingType) where relevant.
  • The difference between toDataFrame and toDataFrameFromPairs (the latter takes explicit path→column pairs and is the nesting-aware builder).
Acceptance criteria
  • Every public, non-deprecated toDataFrame / toDataFrameFromPairs overload is covered by a KDoc, grouped by the semantic blocks above.
  • The CreateDataFrameDsl, TraversePropertiesDsl, and ValueProperty public types and their non-deprecated members are documented; the existing exclude / preserve / List<List<T>>.toDataFrame KDocs are kept or expanded, not removed.
  • No documentation is added for deprecated / @AccessApiOverload overloads.
  • KDocs make clear how source shapes map to rows/columns and how nesting (column groups) is produced.
  • Docs are consistent with the site docs at createDataFrame.html.

Related to the #1479

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/toDataFrame.kt and compare its public non-deprecated APIs with the createDataFrame.html site documentation. Review the existing KDocs and semantic blocks, then document the specified overloads and DSL members, including source-to-row/column mapping, nesting, inference, uniqueness, and traversal behavior without covering deprecated or @AccessApiOverload APIs.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.