Bug Description
If I execute the following command it works:
fab api -A fabric -X get workspaces/3f94c8f3-xxxx-yyyy-zzzz-53c632513149/recoverableItems -q text.value
If using a filter that has spaces it will fail:
fab api -A fabric -X get workspaces/3f94c8f3-xxxx-yyyy-zzzz-53c632513149/recoverableItems -q text.value[?displayName=="<Object name contains spaces>"]
x api: [InvalidInput] Invalid jmespath query (https://jmespath.org)
If using a filter that does not have spaces it will work:
fab api -A fabric -X get workspaces/3f94c8f3-xxxx-yyyy-zzzz-53c632513149/recoverableItems -q text.value[?type=="Notebook"]
{
"status_code": 200,
"text": {
"value": [
{
"id": "24f913d0-xxxx-yyyy-zzzz-c55bee186754",
"displayName": "<Object name contains spaces>",
"description": "New notebook",
"type": "Notebook",
"workspaceId": "3f94c8f3-xxxx-yyyy-zzzz-53c632513149",
"retentionExpirationDateTime": "2026-04-14T18:02:18.5278736",
"parentItemId": null,
"folderId": null
}
]
}
}
Shouldn't the following query only return the id? I.e., 24f913d0-xxxx-yyyy-zzzz-c55bee186754
fab api -A fabric -X get workspaces/3f94c8f3-xxxx-yyyy-zzzz-53c632513149/recoverableItems -q text.value[?type=="Notebook"].id
{
"status_code": 200,
"text": {
"value": [
{
"id": "24f913d0-xxxx-yyyy-zzzz-c55bee186754",
"displayName": "<Object name contains spaces>",
"description": "New notebook",
"type": "Notebook",
"workspaceId": "3f94c8f3-xxxx-yyyy-zzzz-53c632513149",
"retentionExpirationDateTime": "2026-04-14T18:02:18.5278736",
"parentItemId": null,
"folderId": null
}
]
}
}
The solution that I found is to do the filter in PowerShell like this
(fab api -A fabric -X get workspaces/3f94c8f3-xxxx-yyyy-zzzz-53c632513149/recoverableItems | ConvertFrom-Json).text.value | Where-Object { $_.displayName -eq "<Object name contains spaces>" } | Select-Object -ExpandProperty id
24f913d0-xxxx-yyyy-zzzz-c55bee186754
fabric-cli version
1.5.0
Python version
Python 3.13.12
Operating System
Windows
CLI Mode
Command line mode
Authentication Method
Interactive browser login
Steps to Reproduce
- In a Fabric Workspace delete 2 Notebooks with spaces in their names.
- fab auth logout
- fab auth login
- Update the Workspace ID in the commands described in the Bug Description.
Expected Behavior
fab api -A fabric -X get workspaces/3f94c8f3-xxxx-yyyy-zzzz-53c632513149/recoverableItems -q text.value[?displayName=="<Object name contains spaces>"]
Would filter for the object's displayName for the Object name containing spaces.
fab api -A fabric -X get workspaces/3f94c8f3-xxxx-yyyy-zzzz-53c632513149/recoverableItems -q text.value[?displayName=="<Object name contains spaces>"].id
Would filter for the object's displayName for the Object name containing spaces and return only the value for id.
Actual Behavior
See Bug Description.
Additional Context
No response
Possible Solution
No response
Bug Description
If I execute the following command it works:
If using a filter that has spaces it will fail:
If using a filter that does not have spaces it will work:
Shouldn't the following query only return the id? I.e., 24f913d0-xxxx-yyyy-zzzz-c55bee186754
The solution that I found is to do the filter in PowerShell like this
fabric-cli version
1.5.0
Python version
Python 3.13.12
Operating System
Windows
CLI Mode
Command line mode
Authentication Method
Interactive browser login
Steps to Reproduce
Expected Behavior
Would filter for the object's displayName for the Object name containing spaces.
Would filter for the object's displayName for the Object name containing spaces and return only the value for id.
Actual Behavior
See Bug Description.
Additional Context
No response
Possible Solution
No response