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

Abierto
#2,139 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
kotlin
Área
compilers, data

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Kotlin
Estrellas
1.1k
Forks
87
Merge medio
2 d 21 h
PR fusionados (30 d)
40

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Kotlin/dataframe

Todos los issues de Kotlin/dataframe

Issues similares

Más issues de Kotlin

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.