question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sharing collections between Kusto kernels results in a System.InvalidOperationException

See original GitHub issue

Is your feature request related to a problem? Please describe. In Azure Data Explorer, I might craft a KQL query that relies on a collection of objects output by a previous query, such as the following:

let waterspoutStates = StormEvents
  | where EventType == "Waterspout"
  | distinct State;
StormEvents
  | where State in (waterspoutStates)
  | summarize count() by EventType, State

I might want to accomplish the same thing in notebooks using two separate KQL kernels and a C# kernel that processes the content in-between, or to have the output of a parent and child query display in the notebook at the same time, for example:

image

Sharing a scalar variable from C# to KQL kernels works fine, but attempting to share a collection variable in this fashion results in the following System.InvalidOperationException:

Error: System.InvalidOperationException: Error sharing value 'WaterspoutEvents' from kernel 'kql-help' into kernel 'kql-help'. Cannot support value of Type System.Collections.Generic.List`1[Microsoft.DotNet.Interactive.Formatting.TabularData.TabularDataResource]. There is no CSL type that corresponds to 'System.Collections.Generic.List`1[[Microsoft.DotNet.Interactive.Formatting.TabularData.TabularDataResource, Microsoft.DotNet.Interactive.Formatting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]'.
 ---> System.ArgumentException: Cannot support value of Type System.Collections.Generic.List`1[Microsoft.DotNet.Interactive.Formatting.TabularData.TabularDataResource]. There is no CSL type that corresponds to 'System.Collections.Generic.List`1[[Microsoft.DotNet.Interactive.Formatting.TabularData.TabularDataResource, Microsoft.DotNet.Interactive.Formatting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]'.
   at Microsoft.DotNet.Interactive.SqlServer.ToolsServiceKernel.SetValueAsync(String name, Object value, Type declaredType)
   at Microsoft.DotNet.Interactive.KernelExtensions.ShareValue(Kernel fromKernel, Kernel toKernel, String valueName) in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\KernelExtensions.cs:line 236
   --- End of inner exception stack trace ---
   at Microsoft.DotNet.Interactive.KernelExtensions.ShareValue(Kernel fromKernel, Kernel toKernel, String valueName) in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\KernelExtensions.cs:line 240
   at Microsoft.DotNet.Interactive.KernelExtensions.<>c__DisplayClass6_0`1.<<UseValueSharing>b__2>d.MoveNext() in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\KernelExtensions.cs:line 213
--- End of stack trace from previous location ---
   at System.CommandLine.Invocation.CommandHandler.GetExitCodeAsync(Object value, InvocationContext context)
   at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass21_0.<<UseMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass25_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Invocation.InvocationPipeline.InvokeAsync(IConsole console)
   at System.CommandLine.Parsing.ParseResultExtensions.InvokeAsync(ParseResult parseResult, IConsole console)
   at Microsoft.DotNet.Interactive.Commands.DirectiveCommand.InvokeAsync(KernelInvocationContext context) in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\Commands\DirectiveCommand.cs:line 34
   at Microsoft.DotNet.Interactive.Kernel.HandleAsync(KernelCommand command, KernelInvocationContext context) in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\Kernel.cs:line 257
   at Microsoft.DotNet.Interactive.KernelCommandPipeline.<BuildPipeline>b__6_0(KernelCommand command, KernelInvocationContext context, KernelPipelineContinuation _) in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\KernelCommandPipeline.cs:line 57
   at Microsoft.DotNet.Interactive.KernelCommandPipeline.<>c__DisplayClass6_1.<<BuildPipeline>b__3>d.MoveNext() in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\KernelCommandPipeline.cs:line 73
--- End of stack trace from previous location ---
   at Microsoft.DotNet.Interactive.CompositeKernel.LoadExtensions(KernelCommand command, KernelInvocationContext context, KernelPipelineContinuation next) in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\CompositeKernel.cs:line 144
   at Microsoft.DotNet.Interactive.KernelCommandPipeline.<>c__DisplayClass6_0.<<BuildPipeline>g__Combine|2>d.MoveNext() in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\KernelCommandPipeline.cs:line 74
--- End of stack trace from previous location ---
   at Microsoft.DotNet.Interactive.KernelCommandPipeline.SendAsync(KernelCommand command, KernelInvocationContext context) in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\KernelCommandPipeline.cs:line 48

Rename Waterspouts.txt to Waterspouts.ipynb to demonstrate the repro.

Describe the solution you’d like Sharing collection types such as Lists from a C# or KQL kernel into a KQL kernel should be supported.

Describe alternatives you’ve considered N/A

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:4
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
toddbeckettcommented, Jul 12, 2022

+1

1reaction
thomasraynercommented, Jul 12, 2022

This is blocking my team’s use of .NET Interactive, too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Kusto Query Language (KQL) overview - Azure Data Explorer
A Kusto query is a read-only request to process data and return results. The request is stated in plain text, using a data-flow...
Read more >
Using Kusto.Explorer - Azure Data Explorer
This article shows you how to use search and query modes, share your queries, and manage clusters, databases, and tables. Search++ mode. Search ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found