Kotlin / Kotlin/dataframe

Avoid breaking existing code with Iterable<DataSchema>.toDataFrame() calls when enabling the plugin

Open
#1,880 2 comments 0 reactions 1 assignee Claimed by @Jolanrensen View on GitHub
bug
Dominant language
Kotlin
Stars
1.1k
Forks
83
Avg merge
4d 12h
Merged PRs (30d)
30

Description

Problem from example being converted to use plugin found by @Jolanrensen
```kt
@DataSchema
data class MySchema(val i: Int)

fun main() {
val df: DataFrame = listOf(MySchema(1)).toDataFrame() // breaks when plugin is enabled, type is now MySchema_98

df.toList() // breaks when plugin is enabled
}
```

Proposed change:
Add toDataFrame overload. If T is already DataSchema type, no need to introduce plugin-generated local type.
```kt
public inline fun Iterable.toDataFrame(): DataFrame =
@DisableInterpretation toDataFrame {
properties()
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.