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

Error with Pydantic Plugin after upgrading Pycharm to 2023.3 #839

Closed
stv8 opened this issue Dec 6, 2023 · 2 comments · Fixed by #840
Closed

Error with Pydantic Plugin after upgrading Pycharm to 2023.3 #839

stv8 opened this issue Dec 6, 2023 · 2 comments · Fixed by #840

Comments

@stv8
Copy link

stv8 commented Dec 6, 2023

Describe the bug
Receiving the following error after upgrading pycahrm

Stack Trace
com.intellij.openapi.progress.IndicatorCancellationException

java.lang.Throwable: Control-flow exceptions (e.g. this class com.intellij.openapi.progress.CeProcessCanceledException) should never be logged. Instead, these should have been rethrown if caught.
	at com.intellij.openapi.diagnostic.Logger.ensureNotControlFlow(Logger.java:513)
	at com.intellij.idea.IdeaLogger.doLogError(IdeaLogger.java:154)
	at com.intellij.idea.IdeaLogger.error(IdeaLogger.java:145)
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:436)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService.lambda$submit$0(PassExecutorService.java:325)
	at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:197)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: com.intellij.openapi.progress.CeProcessCanceledException: com.intellij.openapi.progress.IndicatorCancellationException
	at com.intellij.serviceContainer.ComponentManagerImplKt$runBlockingInitialization$1.invoke(ComponentManagerImpl.kt:2409)
	at com.intellij.serviceContainer.ComponentManagerImplKt$runBlockingInitialization$1.invoke(ComponentManagerImpl.kt:2397)
	at com.intellij.openapi.progress.ContextKt.prepareIndicatorThreadContext$lambda$5(context.kt:110)
	at com.intellij.openapi.progress.impl.CoreProgressManager.silenceGlobalIndicator(CoreProgressManager.java:972)
	at com.intellij.openapi.progress.ContextKt.prepareIndicatorThreadContext(context.kt:108)
	at com.intellij.openapi.progress.ContextKt.prepareThreadContext(context.kt:78)
	at com.intellij.serviceContainer.ComponentManagerImplKt.runBlockingInitialization(ComponentManagerImpl.kt:2397)
	at com.intellij.serviceContainer.ComponentManagerImplKt.getOrCreateInstanceBlocking(ComponentManagerImpl.kt:2336)
	at com.intellij.serviceContainer.ComponentManagerImpl.doGetService(ComponentManagerImpl.kt:1057)
	at com.intellij.serviceContainer.ComponentManagerImpl.getService(ComponentManagerImpl.kt:988)
	at com.intellij.openapi.updateSettings.impl.UpdateChecker.updateAndShowResult(UpdateChecker.kt:886)
	at com.intellij.openapi.updateSettings.impl.UpdateChecker.checkForUpdate(UpdateChecker.kt:550)
	at com.intellij.diagnostic.DefaultIdeaErrorLogger.canHandle(DefaultIdeaErrorLogger.java:35)
	at com.intellij.diagnostic.DialogAppender.queueAppend(DialogAppender.java:83)
	at com.intellij.diagnostic.DialogAppender.publish(DialogAppender.java:58)
	at java.logging/java.util.logging.Logger.log(Logger.java:980)
	at java.logging/java.util.logging.Logger.doLog(Logger.java:1007)
	at java.logging/java.util.logging.Logger.log(Logger.java:1118)
	at com.intellij.idea.IdeaLogger.doLogError(IdeaLogger.java:169)
	at com.intellij.idea.IdeaLogger.error(IdeaLogger.java:145)
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:436)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:431)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1075)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$3(PassExecutorService.java:392)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:610)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:685)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:641)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:609)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:78)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:391)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:367)
	at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:200)
	at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:184)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:365)
	at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:187)
	... 5 more
Caused by: com.intellij.openapi.progress.IndicatorCancellationException
	at com.intellij.openapi.progress.ContextKt$cancelWithIndicator$1.invokeSuspend(context.kt:146)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
	at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
Caused by: com.intellij.openapi.progress.ProcessCanceledException: java.lang.NoSuchMethodError: 'com.jetbrains.python.psi.types.PyType com.jetbrains.python.psi.types.PyTypeChecker.substitute(com.jetbrains.python.psi.types.PyType, java.util.Map, com.jetbrains.python.psi.types.TypeEvalContext)'
	at com.intellij.openapi.progress.util.AbstractProgressIndicatorBase.throwIfCanceled(AbstractProgressIndicatorBase.java:158)
	at com.intellij.openapi.progress.util.AbstractProgressIndicatorBase.checkCanceled(AbstractProgressIndicatorBase.java:148)
	at com.intellij.codeInsight.daemon.impl.DaemonProgressIndicator.checkCanceled(DaemonProgressIndicator.java:97)
	at com.intellij.openapi.progress.ContextKt$cancelWithIndicator$1.invokeSuspend(context.kt:142)
	... 8 more
Caused by: java.lang.NoSuchMethodError: 'com.jetbrains.python.psi.types.PyType com.jetbrains.python.psi.types.PyTypeChecker.substitute(com.jetbrains.python.psi.types.PyType, java.util.Map, com.jetbrains.python.psi.types.TypeEvalContext)'
	at com.koxudaxi.pydantic.PydanticTypeProvider.dynamicModelFieldToParameter$pydantic_pycharm_plugin(PydanticTypeProvider.kt:568)
	at com.koxudaxi.pydantic.PydanticTypeProvider.dynamicModelFieldToParameter$pydantic_pycharm_plugin$default(PydanticTypeProvider.kt:536)
	at com.koxudaxi.pydantic.PydanticTypeProvider$getPydanticTypeForClass$4.invoke(PydanticTypeProvider.kt:509)
	at com.koxudaxi.pydantic.PydanticTypeProvider$getPydanticTypeForClass$4.invoke(PydanticTypeProvider.kt:508)
	at kotlin.sequences.TransformingSequence$iterator$1.next(Sequences.kt:210)
	at kotlin.sequences.FilteringSequence$iterator$1.calcNext(Sequences.kt:170)
	at kotlin.sequences.FilteringSequence$iterator$1.hasNext(Sequences.kt:194)
	at kotlin.sequences.FilteringSequence$iterator$1.calcNext(Sequences.kt:169)
	at kotlin.sequences.FilteringSequence$iterator$1.hasNext(Sequences.kt:194)
	at com.koxudaxi.pydantic.PydanticTypeProvider.getPydanticTypeForClass(PydanticTypeProvider.kt:997)
	at com.koxudaxi.pydantic.PydanticTypeProvider.getReferenceType(PydanticTypeProvider.kt:45)
	at com.jetbrains.python.psi.impl.PyReferenceExpressionImpl.getReferenceTypeFromProviders(PyReferenceExpressionImpl.java:525)
	at com.jetbrains.python.psi.impl.PyCallExpressionHelper.getCalleeType(PyCallExpressionHelper.java:126)
	at com.jetbrains.python.psi.impl.PyReferenceExpressionImpl.getCallableType(PyReferenceExpressionImpl.java:248)
	at com.jetbrains.python.psi.impl.PyReferenceExpressionImpl.getType(PyReferenceExpressionImpl.java:236)
	at com.jetbrains.python.psi.types.TypeEvalContext.lambda$getType$0(TypeEvalContext.java:181)
	at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:111)
	at com.intellij.openapi.util.RecursionGuard.doPreventingRecursion(RecursionGuard.java:27)
	at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:66)
	at com.jetbrains.python.psi.types.TypeEvalContext.getType(TypeEvalContext.java:170)
	at com.jetbrains.python.psi.impl.PyCallExpressionHelper.getExplicitResolveResults(PyCallExpressionHelper.java:220)
	at com.jetbrains.python.psi.impl.PyCallExpressionHelper.lambda$multiResolveCallee$1(PyCallExpressionHelper.java:192)
	at com.jetbrains.python.psi.PyUtil.getNullableParameterizedCachedValue(PyUtil.java:669)
	at com.jetbrains.python.psi.PyUtil.getParameterizedCachedValue(PyUtil.java:647)
	at com.jetbrains.python.psi.impl.PyCallExpressionHelper.multiResolveCallee(PyCallExpressionHelper.java:188)
	at com.jetbrains.python.psi.impl.PyCallExpressionImpl.multiResolveCallee(PyCallExpressionImpl.java:47)
	at com.jetbrains.python.psi.impl.PyCallExpressionHelper.multiResolveCalleeFunction(PyCallExpressionHelper.java:834)
	at com.jetbrains.python.psi.impl.PyCallExpressionHelper.mapArguments(PyCallExpressionHelper.java:827)
	at com.jetbrains.python.psi.impl.PyCallExpressionImpl.multiMapArguments(PyCallExpressionImpl.java:53)
	at com.jetbrains.python.inlayHints.PythonInlayParameterHintsProvider.getInlayInfoForArgumentList(PythonInlayParameterHintsProvider.kt:44)
	at com.jetbrains.python.inlayHints.PythonInlayParameterHintsProvider.getParameterHints(PythonInlayParameterHintsProvider.kt:145)
	at com.intellij.codeInsight.hints.ParameterHintsPass.process(ParameterHintsPass.java:113)
	at com.intellij.codeInsight.hints.ParameterHintsPass.lambda$doCollectInformation$2(ParameterHintsPass.java:105)
	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
	at com.intellij.codeInsight.hints.ParameterHintsPass.doCollectInformation(ParameterHintsPass.java:105)
	at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:55)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$1(PassExecutorService.java:406)
	at com.intellij.platform.diagnostic.telemetry.helpers.TraceKt.runWithSpanIgnoreThrows(trace.kt:76)
	at com.intellij.platform.diagnostic.telemetry.helpers.TraceUtil.runWithSpanThrows(TraceUtil.java:34)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:401)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1075)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$3(PassExecutorService.java:392)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:610)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:685)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:641)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:609)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:78)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:391)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:367)
	at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:200)
	at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:184)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:365)
	at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:187)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)

To Reproduce
Steps to reproduce the behavior:

  1. Update Pycharm to 2023.3
  2. Open file which imports a pydantic class
  3. See error in console of pycharm

Screenshots
If applicable, add screenshots to help explain your problem.
Also, gif movies are recommended.

Environments (please complete the following information):

  • IDE: Pycharm pro 2023.3
  • OS: macos sonoma 14.1
  • Pydantic Version 1.9.0
  • Plugin version: 0.4.9

Additional context
Add any other context about the problem here.

@stv8
Copy link
Author

stv8 commented Dec 7, 2023

amazing! thank you for the quick fix!!

@koxudaxi
Copy link
Owner

koxudaxi commented Dec 7, 2023

@stv8
Thank you for creating the issue.
The latest EAP and 2023.3 dropped the deprecated method.
We have to wait for them to approve the version to publish to market.
There is a completed version.
https://github.com/koxudaxi/pydantic-pycharm-plugin/releases/tag/v0.4.10
https://koxudaxi.github.io/pydantic-pycharm-plugin/install/#complied-binary

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 a pull request may close this issue.

2 participants