Skip to content
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

Fix toDataFrame for value classes #542

Merged
merged 2 commits into from
Dec 19, 2023
Merged

Conversation

koperagen
Copy link
Collaborator

Problem can be seen here
#526

@koperagen koperagen requested a review from zaleslaw December 15, 2023 19:11
class ValueClassConverter(val unbox: Method, val box: Method)

val valueClassConverter = (it.returnType.classifier as? KClass<*>)?.let { kClass ->
if (!kClass.isValue) return@let null else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need explicit return here? This seems readable enough:

if (!kClass.isValue) null else {

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, thank you


@Test
fun valueClassNullableField() {
val segments = listOf(PathSegment("foo", Speed(2.3)), PathSegment("bar",))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove trailing comma

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated formatting here

@koperagen koperagen force-pushed the fix-toDataFrame-valueclass branch from 8fd4763 to 7ac540a Compare December 18, 2023 15:17
@koperagen koperagen merged commit ff20e53 into master Dec 19, 2023
1 of 2 checks passed
@Jolanrensen Jolanrensen deleted the fix-toDataFrame-valueclass branch March 22, 2024 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants