`implode` on a `FrameColumn` gives inconsistent results
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start by reading implodeImpl, especially the ColumnKind.Frame branch mentioned in the issue, and compare its value construction with the resulting column type. Reproduce the single-group example, then check the multi-group case to see how each cell behaves. Done when implode returns values consistent with the declared type and both examples can be accessed without a ClassCastException.
索引モデルが issue の本文から書いたものです。
説明
Description
val df = dataFrameOf("key", "frames")(
1, dataFrameOf("x")(1),
1, dataFrameOf("x")(2),
)
val result = df.implode("frames")
println(result.frames.kind) // ValueColumn
println(result.frames.type()) // kotlin.collections.List<org.jetbrains.kotlinx.dataframe.DataFrame<*>>
frames is a FrameColumn. After implode it becomes a ValueColumn with type List<DataFrame<*>>, but the cell contains a DataFrame (both frames concatenated), not a List.
println(result.frames)
frames
List<DataFrame<*>>
----
0 [2 x 1]
An attempt access a value (list of dataframes) of this column throws:
val first = result.frames[0]
Exception in thread "main" java.lang.ClassCastException: class org.jetbrains.kotlinx.dataframe.impl.DataFrameImpl cannot be cast to class java.util.List (org.jetbrains.kotlinx.dataframe.impl.DataFrameImpl is in unnamed module of loader 'app'; java.util.List is in module java.base of loader 'bootstrap')
If there is more than one group (e.g. add a row 2, dataFrameOf("x")(3)), there is no exception, but each cell is a list with one concatenated frame:
val df = dataFrameOf("key", "frames")(
1, dataFrameOf("x")(1),
1, dataFrameOf("x")(2),
2, dataFrameOf("x")(3),
)
println(result.frames[0])
gives
[ x
Int
----
0 1
1 2
]
and
println(result.frames[1])
gives
[ x
Int
----
0 3
]
Expected
One of:
List<DataFrame>with the original frames:[[x=1], [x=2]](same rule as for value columns:T→List<T>);- a
FrameColumnwith one concatenated frame:[x=1, x=2].
Possible cause
In implodeImpl, for ColumnKind.Frame the value is concat() (a DataFrame), and the type is List<AnyFrame>.
- 主要言語
- Kotlin
- スター
- 1.1k
- フォーク
- 87
- 平均マージ
- 2日 21時間
- マージ済み PR(30日)
- 40
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Kotlin/dataframe のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
API
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
Kotlin/dataframe#2202 · コメント 3 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Kotlin/dataframe#2195 · コメント 2 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
AX
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信
-
Add minimal KDocs for `print` APIs対応中かも @zaleslaw が 3 日前に担当しました。 オープンKDocs
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
Kotlin/dataframe の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
メンテナーはふだん 4 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
Link Checker Reportオープンautomated issue report
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
openrndr/openrndr-guide#126 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
liberation-data/drivine-cypher-spec#67 ·
メンテナーはふだん 1 日以内に返信
-
feature
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100