Forum Discussion
Gen2 fails while Gen1 works
- 1 year ago
We were finally able to determine what the issue is and we have a fix coming in the next few weeks.
The root cause of the issue is a bug where the function still has the "staging" setting to be enabled regardless if the UI is not showing it. You can verify this by going into the GIT of the Dataflow and seeing the json file for the metadata of the queries in your Dataflow.A simple workaround is to either start with a blank query that doesn't have the staging enabled OR transform the function to a query, change the staging to be disabled and then transform your query back to a function.
Are you able to share some repro steps on what to test?
I'm able to use a custom function, invoke it inside of another query and get things working without issues. I even tested with a data source function inside of another custom function and things still worked for me without the need for things to be in a Group / Folder.
miguel follow this to reproduce
#1 create a function
//fnGetTimestamp
() =>
let
Source = Sql.Database("abc.datamart.fabric.microsoft.com","def"),
NativeResult = Value.NativeQuery(Source, "SELECT GETDATE() AS timestamp", null, [EnableFolding = true]),
TimestampValue = Record.Field(NativeResult{0}, "timestamp")
in
TimestampValue
#2. create a sharepoint query and invoke above on that query and try to insert into a lakehouse destination
#3. It failed for me at #2
what actually worked
#1 I was copying this function from my github repo as I have them for quick copy paste
## instead of copy paste, I ran the query as below and chose to convert to function from the context menu
let
Source = Sql.Database("abc.datamart.fabric.microsoft.com","def"),
NativeResult = Value.NativeQuery(Source, "SELECT GETDATE() AS timestamp", null, [EnableFolding = true]),
TimestampValue = Record.Field(NativeResult{0}, "timestamp")
in
TimestampValue
## once PQ converted the above into a function with blank parameters, I added parameters as required and adjusted the function.
## it also creates a grouping
## from this point onwards, I had no issue invoking the function into other queries