Forum Discussion
Sempy Labs : Create Shortcut
- 1 year ago
I've found the solution to my problem, but the shortcut is created in the form of a schema in my lakehouse, whereas I want a shortcut in the form of a table in my dbo schema.
labs.lakehouse.create_shortcut_onelake(table_name="dbo/Ventes",source_lakehouse="011a5163-f6d2-4e5e-a11f-55e596144317",source_workspace="0867c351-fc09-440d-8258-a04a8d7adcdb",destination_lakehouse="beb576fc-7a5a-4395-8b7b-06b863d436fb",destination_workspace="b31d9a25-19d0-4188-a24f-a697b4b0342d",shortcut_name="Ventes")
Hi Charline_74
You API call code looks ok as pwer official docs
“Target path doesn’t exist” error typically means the source table path or folders do not match what the API expects, so creating the shortcut fails
Lets try to debug it :
Use sempy_labs.lakehouse.get_lakehouse_tables(lakehouse=source_lakehouse, workspace=source_workspace) to list all tables and confirm the exact name shown in the "Table Name" column matches what you pass to table_name
Create shortcut manually ,If that succeeds, note the exact path or table name used and replicate those settings in create_shortcut_onelake.
lets hope this will work .
Thanks