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.
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"]
- nielsvdc8 months agoSuper User
Hi OnurOz, it looks like this is unwanted behavior. Are you able to create a support request at Microsoft for this? I can also offer to help do this.
- bruinsmm8 months agoFrequent Visitor
Hi OnurOz and nielsvdc thanks for your help. I will pass the problem to my colleague who can contact with Microsoft.
- v-priyankata8 months agoCommunity Support
Hi bruinsmm
I hope youโve submitted the support ticket. Once you receive a solution, please share it here so it can help others facing the same issue. If you have any further questions, feel free to reach out to the community.
Thanks.
- bruinsmm8 months agoFrequent Visitor
Hi nielsvdc Due to circumstances, we cannot submit this problem to Microsoft. Would you please submit this problem to Microsoft?
- nielsvdc8 months agoSuper User
I have reported the issue under request ID 2512121420001293.