-
Notifications
You must be signed in to change notification settings - Fork 75
.toDataFrame
fixes
#1475
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
.toDataFrame
fixes
#1475
Conversation
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.
Great, this logic is now really clear!
But please add a KDoc - or at least a comment for now, - to clearly define the behavior of toDataFrame
; it's not actually trivial.
val childCol = df[Entry::child] | ||
childCol.kind() shouldBe ColumnKind.Group | ||
childCol.asColumnGroup().columnsCount() shouldBe 0 | ||
childCol.kind() shouldBe ColumnKind.Value |
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.
Oh, that was weird, didn't know!
I have to disagree. Adding val myFunction: (String) -> Unit = { arg1 ->
doSomething()
}
fun myFunction(arg1: String) {
doSomething()
} It increases cognitive load. I'd be fine if they were all single-line-returns too, but we're a JetBrains Kotlin library, so if we don't follow the guidelines, then who does? :P But I understand it can be annoying if it fails the build :) For that I can recommend installing the KtLint plugin in the IDE and binding it to the reformatter, Ctrl+Alt+L. It highlights these cases and can fix them with one push of a button, or even upon file-save. Personally, I use it with pleasure, and as a result, the ktLintCheck almost never complains even though I often forget commas, write too long lines etc. And yes, sometimes it's a bit of a back-and-forth between me and the linter, but in the end the code looks clean, consistent, and readable. |
I agree with the following
However in Kotlin anything can be a single expression:
Key point why i'd like that function to have a body: a lot of lines of code in the expression. We can keep this rule but split expressions into multiple statements, and technically linter won't complain |
core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/toDataFrame.kt
Outdated
Show resolved
Hide resolved
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.
good increase in robustness :)
core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/toDataFrame.kt
Show resolved
Hide resolved
1af6992
to
217e2bc
Compare
|
9f66401
to
01b2fd5
Compare
Fixes #1465
Btw i think strict
ktlint_standard_function-expression-body
rule is unnecessary, functions with return and with expression body can be a preference and coexist. At least for me this rule ALWAYS fails and forces me to rewrite