`implode` on a `FrameColumn` gives inconsistent results
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 64/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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>.
- Lenguaje dominante
- Kotlin
- Estrellas
- 1.1k
- Forks
- 87
- Merge medio
- 2 d 21 h
- PR fusionados (30 d)
- 40
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Kotlin/dataframe
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Add `columnOf(vararg DataFrame<T: DataRowSchema>): FrameColumn<T>` overload for compatibilityAbiertoAPI
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Kotlin/dataframe#2202 · 3 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Kotlin/dataframe#2195 · 2 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
AX
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
Los mantenedores suelen responder en 1 día
-
Add minimal KDocs for `print` APIsPosiblemente ocupada @zaleslaw la tomó hace 3 días. AbiertoKDocs
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
Todos los issues de Kotlin/dataframe
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
Los mantenedores suelen responder en 4 días
-
feat: 插入提示词时默认追加到输入框,长按才替换Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
Link Checker ReportAbiertoautomated issue report
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
openrndr/openrndr-guide#126 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
liberation-data/drivine-cypher-spec#67 ·
Los mantenedores suelen responder en 1 día
-
feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100