Compiler plugin: refine `reorderColumnsBy` / `reorderColumnsByName` with `inFrameColumns`

オープン
#2,139 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
kotlin
領域
compilers, data

調査の方向性

Start with the ReorderColumnsByName interpreter in the Kotlin repository and the reorderColumnsByName / reorderColumnsBy overloads that take inFrameColumns. Step 1 depends on the dataframe-dev bump that includes #2130, so the change cannot be made until that lands. Done means the new interpreter declares inFrameColumns, the overload carries @Refine and @Interpretable, and the compile-time schema matches the runtime column order for nested frame columns.

索引モデルが issue の本文から書いたものです。

説明

Compiler plugin

reorderColumnsByName(atAnyDepth, desc, inFrameColumns) and reorderColumnsBy(atAnyDepth, desc, inFrameColumns) { }
were added in #2130 without @Refine. With the compiler plugin, the result of such a call keeps the receiver's
compile-time schema, so its column order is not updated.

They are not refined because the ReorderColumnsByName interpreter in the Kotlin repository declares only
receiver, atAnyDepth and desc. An argument the interpreter does not declare makes interpret() return
null, and the plugin then materializes an empty schema, so accessors on the result stop compiling. An
interpreter name the plugin does not know has the same effect.

Steps:

  1. After dataframe-dev in the Kotlin repository includes #2130, add inFrameColumns support to the
    interpreter (a new interpreter, or val Arguments.inFrameColumns: Boolean by arg(defaultValue = Present(false))).
  2. Add @Refine / @Interpretable to the new reorderColumnsByName overload. Do this only once the minimal
    Kotlin version supported with the compiler plugin contains step 1; with an older plugin the call gets an
    empty schema.
  3. Optionally, refine reorderColumnsBy too. Like by / byDesc, its expression is arbitrary code.

Until the dataframe-dev bump, reorderColumnsByName() is interpreted with the old :core, which still
reorders the columns inside frame columns, so the compile-time schema of nested frame columns can differ
from the runtime one. Columns are accessed by name, so code keeps working.

主要言語
Kotlin
スター
1.1k
フォーク
87
平均マージ
2日 21時間
マージ済み PR(30日)
40

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Kotlin/dataframe のほかの issue

Kotlin/dataframe の issue をすべて見る

似ている issue

Kotlin の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。