microsoft / vscode-powerquery-sdk

Power Query Connector Development SDK for VS Code
MIT License
71 stars 11 forks source link

Setting credentials fails when multiple data sources are used #158

Open bgribaudo opened 2 years ago

bgribaudo commented 2 years ago

Preflight Checklist

Power Query SDK

0.1.7

Regression From

No response

Platform

Windows

Architecture

x64

OS Version

No response

VSCode version

No response

PQSdkTool Path

No response

Bug Description

When "Set credential" or pqTest set-credential is run for a file that uses multiple data sources, credential setting dies with an error along the lins of: Error: Expected 1 data source in expression, but 2 were found..

Steps to Reproduce

Connector:

section MyTester;

[DataSource.Kind="MyTester"]
shared MyTester.Do = () => "hi";

[DataSource.Kind="MyTester2"]
shared MyTester2.Do = (code) => "hi";

MyTester = [Authentication = [Implicit = []]];  

MyTester2 = [Authentication = [Implicit = []]];  

Test query:

{ MyTester.Do(), MyTester2.Do("abc") }

Actual Experience

PQTest.exe set-credential `
>> --extension "c:\Users\ben\Desktop\TestConnector\BenTest\bin\AnyCPU\Debug\BenTest.mez"`
>> --queryFile "c:\Users\ben\Desktop\TestConnector\BenTest\BenTest.query.pq"`
>> --prettyPrint -ak Anonymous
Error: Expected 1 data source in expression, but 2 were found.

Expected Experience

Should be allowed to set credentials.

In order for this to work, need a way to specify from the command line which data source I'm setting credentials for, then would need to run set-credentials twice, once per source.

Additional Context

No response

bgribaudo commented 2 years ago

Related: https://github.com/microsoft/vscode-powerquery-sdk/issues/154#issuecomment-1277600947

AlanRynne commented 1 year ago

This issue is preventing me from getting my unit tests to work on VSCode without having to split them into individual *.query.pq files. The new extension is already a great improvement over Visual Studio, having this would be the icing on the cake! 🎂

Is there an ETA on this? :)