-
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
Build config and Debug mode #796
Conversation
….version` using buildConfig
core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/DataColumnImpl.kt
Outdated
Show resolved
Hide resolved
* This only runs with `kotlin.dataframe.debug=true` in gradle.properties | ||
*/ | ||
if (BuildConfig.DEBUG) { | ||
require(values.all { it matches type }) { |
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.
It checks all values, right? Is it worth to check random 10-20 numbers from the column?
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.
If we only check a handful of values there's a chance we won't catch the outlier and get flaky tests.
# Enables debug mode for dataframe. | ||
# This can make certain tests run that should not be run in production. | ||
# It can also be turned on from the command line with `-Pkotlin.dataframe.debug=true` | ||
kotlin.dataframe.debug=false |
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.
does it mean, that we could add more modes, with different names, it's not a strongly-defined schema?
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.
indeed, just an argument I came up with. Similar to the add.ksp argument.
It's not strongly typed, but when read it tries to parse the argument as Boolean and if failed it defaults to false
…enabled. Updated contribution guide too. TC will have to be updated manually
Thanks! |
Generated sources will be updated after merging this PR. |
This PR adds the buildconfig plugin to the project.
This achieves two things:
BuildConfig.VERSION
. We can use this well in the Jupyter integration where we're often interested which dataframe version is pulled into the notebook when doing a%use dataframe
.type: KType
inDataColumnImpl
mismatches actual values sometimes #713.By simply adding
-Pkotlin.dataframe.debug=true
to the build on TC, we can run the extra checks from the issue. By default this check should be off, as it costs performance, but it's very valuable for catches bugs. We can useBuildConfig.DEBUG
in other places in the future as well.See each commit for more info.
We should add the flag to TC only after #713 is solved completely, otherwise all builds will fail.