semantic-link-labs icon indicating copy to clipboard operation
semantic-link-labs copied to clipboard

Shortcuts not working to other source items than lakehouse & missing conflictpolicy option

Open nielsvdc opened this issue 8 months ago • 2 comments

Describe the bug Problem 1: The sempy_labs.lakehouse.create_shortcut_onelake function is not using the full functionality of the API. With the API I am able to create a shortcut to a lakehouse table, warehouse table, mirrored database table, etc., but using the function functionality only enables me to create a shortcut to another lakehouse.

This is probably of the following code in the function on lines 71-73, that explicitly only resolves the lakehouse name and id as a shortcut source.

    (source_lakehouse_name, source_lakehouse_id) = resolve_lakehouse_name_and_id(
        lakehouse=source_lakehouse, workspace=source_workspace_id
    )

Problem 2: The sempy_labs.lakehouse.create_shortcut_onelake function is missing the shortcutConflictPolicy functionality, with which you can define the action that needs to be taken when the shortcut already exists. This could be "Abort" or "GenerateUniqueName".

Expected behavior The function should be changed to enable other source types than lakehouses. The source item parameter should still be a UUID or item name. When a source item name is passed and more than 1 items are found, an optional item type parameter is required. The shortcutConflictPolicy should be added as a parameter option. The default should be "Abort".

Optional The parameter name "source_lakehouse" should be changed to "source_item".

nielsvdc avatar Mar 24 '25 22:03 nielsvdc

Thanks for the feedback. Added the 'shortcut_conflict_policy' parameter in a PR for the next release. Will be expanding the scope of this function to allow shortcutting to different artifacts. I believe there is a PR for this already from the community. I'll be holding off on that until after FabCon as it will require new parameter names.

m-kovalsky avatar Mar 26 '25 20:03 m-kovalsky

Shortcut Conflict Policy has been added in 0.9.7.

m-kovalsky avatar Apr 02 '25 04:04 m-kovalsky