-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update compiler plugin #832
Changes from all commits
6b892d1
7e6825d
874abff
2d31cd6
01d99f6
6318036
10935d2
b989c63
d86d589
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -436,6 +436,8 @@ internal fun guessValueType(values: Sequence<Any?>, upperBound: KType? = null, l | |
collectionClasses.add(it.javaClass.kotlin) | ||
} | ||
|
||
is Function<*> -> classes.add(Function::class) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why not :) Maybe we should change the rendering for functions in dataframes though. After a quick test I found it looks like:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sadly for such lambda objects toString is weird. I tried to look at the object in the debugger, but there's literally nothing that hints at signature or anything useful There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm you'd think there was a way in kotlin to detect it's a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I run the dev version of this PR's branch in the notebook. (so publish to maven local and use v=0.14.0-dev) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, ok, so the fix is needed anyway |
||
|
||
else -> classes.add(it.javaClass.kotlin) | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.jetbrains.kotlinx.dataframe.impl.api | ||
|
||
internal fun <T> withValuesImpl(header: List<String>, values: List<T>): List<Pair<String, List<T>>> { | ||
val ncol = header.size | ||
|
||
require(header.isNotEmpty() && values.size.rem(ncol) == 0) { | ||
"Number of values ${values.size} is not divisible by number of columns $ncol" | ||
} | ||
|
||
val nrow = values.size / ncol | ||
|
||
return (0 until ncol).map { col -> | ||
val colValues = (0 until nrow).map { row -> | ||
values[row * ncol + col] | ||
} | ||
header[col] to colValues | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my testrun of the compiler plugin I now cannot use
update {}.with {}
anymore, justfillNulls {}.with {}
. It giveswhen trying to access the updated column. Is this intended for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now yes, there's such issue because plugin fails to interpret update { }.with { } (update not supported) and fallback to an empty schema. Will fix