interactive icon indicating copy to clipboard operation
interactive copied to clipboard

Unable to define array dynamic within local datatable in Kusto kernel

Open pshelton-skype opened this issue 1 year ago • 0 comments

Describe the bug

Running the following code in a Kusto kernel results in

let x = datatable(column1:string, column2:dynamic) 
[ 
  '1', '[1]',
  '2', '[2]'
];
x
Error: StreamJsonRpc.RemoteInvocationException: SQL Execution error: A fatal error occurred.
Incorrect syntax was encountered while [
'1', '[1]',
'2', '[2]'
];
x
was being parsed.
at StreamJsonRpc.JsonRpc.InvokeCoreAsync[TResult](RequestId id, String targetName, IReadOnlyList`1 arguments, IReadOnlyList`1 positionalArgumentDeclaredTypes, IReadOnlyDictionary`2 namedArgumentDeclaredTypes, CancellationToken cancellationToken, Boolean isParameterObject)
at Microsoft.DotNet.Interactive.SqlServer.ToolsServiceClient.ExecuteQueryStringAsync(Uri ownerUri, String queryString, CancellationToken contextCancellationToken)
at Microsoft.DotNet.Interactive.SqlServer.ToolsServiceKernel.Microsoft.DotNet.Interactive.IKernelCommandHandler<Microsoft.DotNet.Interactive.Commands.SubmitCode>.HandleAsync(SubmitCode command, KernelInvocationContext context)
at Microsoft.DotNet.Interactive.Kernel.HandleAsync(KernelCommand command, KernelInvocationContext context) in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\Kernel.cs:line 330
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 60
at Microsoft.DotNet.Interactive.KernelCommandPipeline.SendAsync(KernelCommand command, KernelInvocationContext context) in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\KernelCommandPipeline.cs:line 41

Note that the following both work:

let x = datatable (hello:string, goodbye:string ) ['hello', 'goodbye'];
x
let x = datatable(a:string, b:dynamic ) ['hello', '{122}'];
x

This is of course completely valid in Kusto Explorer: Image

Please complete the following:

Which version of .NET Interactive are you using? (In a notebook, run the #!about magic command. ): .NET Interactive © 2020 Microsoft Corporation Version: 1.0.522904+cdfa48b2ea1a27dfe0f545c42a34fd3ec7119074 Library version: 1.0.0-beta.24229.4+cdfa48b2ea1a27dfe0f545c42a34fd3ec7119074 Build date: 2024-10-27T19:31:09.0232372Z

  • OS
    • [X] Windows 11
    • [ ] Windows 10
    • [ ] macOS
    • [ ] Linux (Please specify distro)
    • [ ] iOS
    • [ ] Android
  • Browser
    • [ ] Chrome
    • [X] Edge
    • [ ] Firefox
    • [ ] Safari
  • Frontend
    • [ ] Jupyter Notebook
    • [ ] Jupyter Lab
    • [ ] nteract
    • [X] Visual Studio Code
    • [ ] Visual Studio Code Insiders
    • [ ] Visual Studio
    • [ ] Other (please specify)

Screenshots

If applicable, add screenshots to help explain your problem.

Image

pshelton-skype avatar Oct 27 '24 21:10 pshelton-skype