Permission error when listing dataset partitions

Solved!
SanderVW
Level 3
Permission error when listing dataset partitions

I am encountering an issue when trying to start a dashboard. I need to list partitions from certain datasets but am receiving an error regarding permission:

DataikuException: com.dataiku.dip.exceptions.UnauthorizedException: Failed to read project permissions

I am using the code below to connect to my project and call the partitioning data. 

proj = dataiku.api_client().get_default_project()
dataset_names=['name1','name2','name3','name4','name5']
datasets=[proj.get_dataset(name) for name in dataset_names]
partitions=[dataset.list_partitions() for dataset in datasets]

I believe the connection itself is fine as I've tested to see that datasets is not empty so it seems it really is a permission issue. I am the admin of this system so I should have enough rights to change this but am unsure on where to do this.


Operating system used: Windows

0 Kudos
1 Solution
Turribeach

You get this error if the dataset or project doesn't exist. Dataset names are case sensitive. Also you need to use the Dataset ID rather than the Dataset name so make sure you are using the correct ID. The Dataset ID is displayed in the browser's URL when you navigate to the dataset. Personally I would use:

datasets = project.list_datasets()

to fetch the project datasets and then filter the required ones rather than passing names that could be wrong or not exist.

View solution in original post

2 Replies
Turribeach

You get this error if the dataset or project doesn't exist. Dataset names are case sensitive. Also you need to use the Dataset ID rather than the Dataset name so make sure you are using the correct ID. The Dataset ID is displayed in the browser's URL when you navigate to the dataset. Personally I would use:

datasets = project.list_datasets()

to fetch the project datasets and then filter the required ones rather than passing names that could be wrong or not exist.

SanderVW
Level 3
Author

Thank you very much! This was indeed the issue. 

I did not think the names were incorrect as I've gotten an error earlier that specifically stated it could not find a dataset with the name so I assumed it was able to find it now but was not able to get permission.

Dashboard up and working again ๐Ÿ™‚

0 Kudos