Forum Discussion

ferryv's avatar
ferryv
Resolver II
1 year ago
Solved

Github PowerBi connector - JSON error

When connecting to the raw data in github via the Github Connector (I have e.g. a function in the repo that I want to use to process information, like e.g. expnding all columns), I get a JSON error. 

 

It looks like the function is attempting to output a JSON document, but since the rawdata itself might have a comment in it, like:

 

/*
Some comments
*/

(previousStep as table)=> 
...

 

The JSON document returned comes up with an erorr that there are unknown characters (likely due to the comments as it references a "/" on position 0.

 

While I can get the data via Web.Contents fine (don't get errors in Desktop and using Expression.Evaluate allows me to use the function), the issue I am having is that while I can connect via OAuth to the repo via the Github connector, the Web.Contents authentication does not appear to allow OAuth connection, but requires e.g. a PAT.

 

A subsequent issue via Web.Contents is that any subsequent API call (e.g. to JIRA) will not refresh once published as an error comes up stating:

 

[Unable to combine data] .... references other queries or steps, so it may not directly access a data source. Please rebuild this data combination.. Which I am trying to resolve and I want to check if the Github connector resolves this..

 

Can someone advise if it is possible to somehow strip or ignore the comments then invoking the step?

 

 For example, the Github steps would be:

 

let 
Connect = Github.Tables("<owner>", "<repo>"){[Key="contents"]}[Data],

Source =Connect( "https://raw.githubusercontent.com/<owner>/<repo>/main/<filename>.pq" )
in Source

 where <filename> is the file containing the function with the comments.

 

When using Web.Contents, similar output would be achieved via 

Text.FromBinary(Web.Contents("https://raw.githubusercontent.com/<owner>/<repo>/main/<filename>.pq"))

 

4 Replies