Forum Discussion
Datasetnotfoundexception even though the dataset exists when using sempy fabric functions
Hi,
I am currently getting DatasetNotFoundException: Dataset '<datasetId>' not found in workspace '<workspaceId>'
(Just replaced the actual values with <>)
The issue is the dataset actually exists. I can even see the dataset when querying via the API.
import sempy.fabric as fabric
import json
workspaceId = 'workspaceid_here'
client = fabric.FabricRestClient()
try:
response = client.get(
f'https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/semanticModels'
)
print(response.text)
except Exception as e:
print(e)
When I try using the list_columns() function, I get the datasetnotfoundexception error as stated above. (again, actual values were replaced in this post)
import sempy.fabric as fabric
df_columns = fabric.list_columns(dataset=datasetid, workspace=workspaceId)
df_columns = df_columns[['Table Name', 'Column Name', 'Data Type']]
display(df_columns)
Even using list_datasets() returns an IndexError: list index out of range
import sempy.fabric as fabric
text = fabric.list_datasets()
display(text)
Any ideas why this is happening? Why the fabric package functions cannot find the datasets even though they actually exist?
Thank you.
Not sure how to delete this but this has been solved. I just created a new table after enabling the sync the default power BI semantic model and it is now showing the updated dataset tables.
8 Replies
- russelpHelper I
Just got the idea that this might be because the dataset is not refreshed.
1. Can anyone confirm this?
2. If 1 is the reason, how do I refresh the default dataset (coming from a lakehouse or a warehouse in onelake) to reflect the latest changes? Can the default semantic models not be refreshed?
I also enabled the option below but somehow the default semantic model still doesn't have all the tables from the lakehouse.
- russelpHelper I
Not sure how to delete this but this has been solved. I just created a new table after enabling the sync the default power BI semantic model and it is now showing the updated dataset tables.
- AnonymousNot applicable
Hi russelp
Glad that your query got resolved. Please continue using Fabric Community for any help regarding your queries.- russelpHelper I
Hi Anonymous ! Thank you! I don't want to open up another thread just for this follow up question related to this so, does the sempy fabric function list_datasets() only show my owned datasets? I created my lakehouses and able to see the datasets but when my coworker created one, I am not able to see that new dataset.