Skip to content

fix(set): set onelake shortcut with query target bug fix - #105

Merged
may-hartov merged 6 commits into
microsoft:mainfrom
may-hartov:dev/mahartov/set_shorcuts
Dec 29, 2025
Merged

may-hartov merged 6 commits into
microsoft:mainfrom
may-hartov:dev/mahartov/set_shorcuts

Conversation

@may-hartov

Copy link
Copy Markdown
Collaborator

The set shortcut command fails when using -q target with the following error:
set: [InvalidInput] The new name matches the existing name. No changes will be made

Root Cause
When the name property is not the target of the set shortcut command, the "name" of the shortcut remains the same - and the operation will fail (in fab_fs_set_onelake), even though the supported queries defined in JMESPATH_UPDATE_SHORTCUT include target.

Updating the shortcut target is a valid and useful scenario, for example when redirecting a shortcut to a different lakehouse

Fix
When the command query is target, the CLI now calls the Create Shortcut API with ShortcutConflictPolicy=OverwriteOnly.
Since OneLake shortcuts do not expose a public Update API, updating a shortcut is performed by creating it again with the same name and path while using the OverwriteOnly conflict policy, which replaces the existing shortcut when the name and path are unchanged.
This behavior aligns with the documented REST API semantics. [OneLake Sh...soft Learn | External]
Validation

Added test coverage for the target update scenario.

Comment thread src/fabric_cli/commands/fs/set/fab_fs_set_onelake.py
@may-hartov
may-hartov merged commit bddff6b into microsoft:main Dec 29, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants