You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added ability to target all Fabric data store types with create_shortcut_onelake (#501)
* Added ability to use any type of Fabric data store for the source of the create_shortcut_onelake function.
* better provide backwards compatibility
* optimize resolving of source and destination item names and ids
* Merge latest upstream changes from main branch
The Fabric lakehouse in which the shortcut will be created.
47
48
Defaults to None which resolves to the lakehouse attached to the notebook.
@@ -51,6 +52,10 @@ def create_shortcut_onelake(
51
52
or if no lakehouse attached, resolves to the workspace of the notebook.
52
53
shortcut_name : str, default=None
53
54
The name of the shortcut 'table' to be created. This defaults to the 'table_name' parameter value.
55
+
source_item : str | uuid.UUID, default=None
56
+
The source Fabric data store item in which the table resides. Can be either the Name or ID of the item.
57
+
source_item_type: str, default="Lakehouse"
58
+
The source Fabric data store item type. Options are 'Lakehouse', 'Warehouse', 'MirroredDatabase', 'SQLDatabase', and 'KQLDatabase'.
54
59
source_path : str, default="Tables"
55
60
A string representing the full path to the table/file in the source lakehouse, including either "Files" or "Tables". Examples: Tables/FolderName/SubFolderName; Files/FolderName/SubFolderName.
56
61
destination_path: str, default="Tables"
@@ -59,6 +64,14 @@ def create_shortcut_onelake(
59
64
When provided, it defines the action to take when a shortcut with the same name and path already exists. The default action is 'Abort'. Additional ShortcutConflictPolicy types may be added over time.
60
65
"""
61
66
67
+
ifsource_itemisNone:
68
+
if"source_lakehouse"inkwargs:
69
+
source_item=kwargs.get("source_lakehouse")
70
+
else:
71
+
raiseValueError(
72
+
f"{icons.red_dot} The 'source_item' parameter must be provided."
f"{icons.green_dot} The shortcut '{shortcut_name}' was created in the '{destination_lakehouse_name}' lakehouse within the '{destination_workspace_name}' workspace. It is based on the '{table_name}' table in the '{source_lakehouse_name}' lakehouse within the '{source_workspace_name}' workspace."
167
+
f"{icons.green_dot} The shortcut '{shortcut_name}' was created in the '{destination_lakehouse_name}' lakehouse within the '{destination_workspace_name}' workspace. It is based on the '{table_name}' table in the '{source_item_name}' {source_item_type} within the '{source_workspace_name}' workspace."
0 commit comments