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

K2 preparation #708

Merged
merged 11 commits into from
May 31, 2024
Merged

K2 preparation #708

merged 11 commits into from
May 31, 2024

Conversation

Jolanrensen
Copy link
Collaborator

Working towards fixing #649.
This branch does not yet bump the version to Kotlin 2.0, as that will require our bootstrapping to be updated, but it further readies the project for the update by fixing some bugs and tests that occur when setting the project to 2.0.

@Jolanrensen Jolanrensen mentioned this pull request May 27, 2024
Closed
…ColumnSet` is now more efficient and retains the original object if it already was a ColumnSet. (preventing bugs again)
…egateColumn implement both SingleColumn<C>, ColumnSet<C>. Changed the factory functions to explicitly accept either of those only.
…behavior changes. Also improved readability with ?:-hell in that function.
@Jolanrensen Jolanrensen marked this pull request as ready for review May 28, 2024 12:19
@@ -40,21 +40,20 @@ internal fun <T, C, K, R> Gather<T, C, K, R>.gatherImpl(
// optimization when no filter is applied
if (filter == null) {
// add key and value columns
df = df.add { // add columns for names and values
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hm :) It's good it fixes the test, but previous code looks reasonable too. It should work, right? What was the error?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It was something really vague with reflection:

Function 'gatherImpl$lambda$7' (JVM signature: gatherImpl$lambda$7(Lorg/jetbrains/kotlinx/dataframe/columns/ColumnAccessor;Lorg/jetbrains/kotlinx/dataframe/columns/ColumnAccessor;Ljava/util/List;Ljava/util/List;Lkotlin/jvm/functions/Function1;Lorg/jetbrains/kotlinx/dataframe/api/Gather;Lorg/jetbrains/kotlinx/dataframe/api/AddDsl;)Lkotlin/Unit;) not resolved in file class org.jetbrains.kotlinx.dataframe.impl.api.GatherKt: no members found
kotlin.reflect.jvm.internal.KotlinReflectionInternalError: Function 'gatherImpl$lambda$7' (JVM signature: gatherImpl$lambda$7(Lorg/jetbrains/kotlinx/dataframe/columns/ColumnAccessor;Lorg/jetbrains/kotlinx/dataframe/columns/ColumnAccessor;Ljava/util/List;Ljava/util/List;Lkotlin/jvm/functions/Function1;Lorg/jetbrains/kotlinx/dataframe/api/Gather;Lorg/jetbrains/kotlinx/dataframe/api/AddDsl;)Lkotlin/Unit;) not resolved in file class org.jetbrains.kotlinx.dataframe.impl.api.GatherKt: no members found
	at kotlin.reflect.jvm.internal.KDeclarationContainerImpl.findFunctionDescriptor(KDeclarationContainerImpl.kt:149)
	at kotlin.reflect.jvm.internal.KFunctionImpl.descriptor_delegate$lambda$0(KFunctionImpl.kt:62)
	at kotlin.reflect.jvm.internal.KFunctionImpl.accessor$KFunctionImpl$lambda0(KFunctionImpl.kt)
	at kotlin.reflect.jvm.internal.KFunctionImpl$$Lambda$0.invoke(Unknown Source)
	at kotlin.reflect.jvm.internal.ReflectProperties$LazySoftVal.invoke(ReflectProperties.java:70)
	at kotlin.reflect.jvm.internal.ReflectProperties$Val.getValue(ReflectProperties.java:32)
	at kotlin.reflect.jvm.internal.KFunctionImpl.getDescriptor(KFunctionImpl.kt:61)
	at kotlin.reflect.jvm.internal.KFunctionImpl.getDescriptor(KFunctionImpl.kt:42)
	at kotlin.reflect.jvm.internal.KCallableImpl._typeParameters$lambda$9(KCallableImpl.kt:85)
	at kotlin.reflect.jvm.internal.KCallableImpl.accessor$KCallableImpl$lambda3(KCallableImpl.kt)
	at kotlin.reflect.jvm.internal.KCallableImpl$$Lambda$3.invoke(Unknown Source)
	at kotlin.reflect.jvm.internal.ReflectProperties$LazySoftVal.invoke(ReflectProperties.java:70)
	at kotlin.reflect.jvm.internal.KCallableImpl.getTypeParameters(KCallableImpl.kt:89)
	at kotlin.jvm.internal.CallableReference.getTypeParameters(CallableReference.java:156)
	at kotlin.reflect.jvm.internal.ReflectionFactoryImpl.typeParameter(ReflectionFactoryImpl.java:135)
	at kotlin.jvm.internal.Reflection.typeParameter(Reflection.java:175)
	at org.jetbrains.kotlinx.dataframe.impl.api.GatherKt.gatherImpl$lambda$7(gather.kt:173)
	at org.jetbrains.kotlinx.dataframe.api.AddKt.add(add.kt:217)
	at org.jetbrains.kotlinx.dataframe.impl.api.GatherKt.gatherImpl(gather.kt:43)
	at org.jetbrains.kotlinx.dataframe.api.GatherKt.into(gather.kt:74)
	at org.jetbrains.kotlinx.dataframe.api.GatherKt.into(gather.kt:79)
	at org.jetbrains.kotlinx.dataframe.api.GatherTests.gather(gather.kt:99)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:112)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:40)
	at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:60)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:52)
	at jdk.internal.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
	at jdk.proxy1/jdk.proxy1.$Proxy2.processTestClass(Unknown Source)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker$2.run(TestWorker.java:176)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.executeAndMaintainThreadName(TestWorker.java:129)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:100)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:60)
	at org.gradle.process.internal.worker.child.ActionExecutionWorker.execute(ActionExecutionWorker.java:56)
	at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:113)
	at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:65)
	at worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:69)
	at worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:74)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If you're curious, here I've reverted the changes: https://github.com/Kotlin/dataframe/tree/k2-gatherImpl-broken

Copy link
Collaborator

@koperagen koperagen May 30, 2024

Choose a reason for hiding this comment

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

Wow. Let's report this on YouTrack then? I think there's no need to try minimizing this and might just share a branch with a failing test

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@koperagen
Copy link
Collaborator

Thank you!

@Jolanrensen Jolanrensen merged commit a8dad48 into master May 31, 2024
4 checks passed
@Jolanrensen Jolanrensen deleted the k2 branch May 31, 2024 10:37
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