Forum Discussion
Parameters FabricVariablesClient and FabricLakehouseClient in one udf function
Hi bruinsmm
this looks to me like an undocumented runtime limitation or a bug. Because I am getting the same error too.
However, in official github repository for the UDFs, I saw an example that requires that this works:
fabric-user-data-functions-samples/PYTHON/Warehouse/export_warehouse_data_to_lakehouse.py at main ยท microsoft/fabric-user-data-functions-samples
In the example above, I see two connections injected.
I suggest filing a bug to the team using this link: https://github.com/microsoft/fabric-user-data-functions-samples/issues
Hope that helps
Onur
๐ If this post helped you, feel free to give it some Kudos! ๐
โ And if it answered your question, please mark it as the accepted solution.
- OnurOz8 months agoResolver III
I've dug more into this and identified a very weird behaviour. If I use FabricSQLConnection together with the FabricLakehouseClient it works. However If I use the FabricVariablesClient together with any of them, that is not working and throwing exactly the same internal error.
import fabric.functions as fn udf = fn.UserDataFunctions() @udf.connection(argName="variables", alias="varlib") @udf.function() def this_works(variables: fn.FabricVariablesClient )-> str: return variables.getVariables()["x"] @udf.connection(argName="variables", alias="varlib") @udf.connection(argName="myWarehouse", alias="fabWH") @udf.function() def this_fails(variables: fn.FabricVariablesClient, myWarehouse: fn.FabricSqlConnection, )-> str: return variables.getVariables()["x"] @udf.connection(argName="variables", alias="varlib") @udf.connection(argName="myLakehouse", alias="fablakehouse") @udf.function() def this_fails_too(variables: fn.FabricVariablesClient, myLakehouse: fn.FabricLakehouseClient, )-> str: return variables.getVariables()["x"]