-
Notifications
You must be signed in to change notification settings - Fork 75
Open
Labels
researchThis requires a deeper dive to gather a better understandingThis requires a deeper dive to gather a better understanding
Milestone
Description
Support GenerateConstructor
annotation on companion object
of schema interface to generate default implementation of that interface and append
overload for DataFrame
:
@DataSchema
interface Record {
val a: Int
val b: Int
@GenerateConstructor
companion object
}
// region Generated Code
operator fun Record.Companion.invoke(a: Int, b: Int): Record =
object: Record {
override val a = a
override val b = b
}
fun DataFrame<Record>.append(vararg rows: Record) = concat(rows.asIterable().toDataFrame())
// endregion
// usage:
listOf(Record(1,2), Record(3,4))
.toDataFrame()
.append(Record(5,6))
.add("sum") { a + b }
Metadata
Metadata
Assignees
Labels
researchThis requires a deeper dive to gather a better understandingThis requires a deeper dive to gather a better understanding