Getting an issue while reading excel file using "dkuManagedFolderDownloadPath" function of dataiku

shashankmittal
Level 2
Getting an issue while reading excel file using "dkuManagedFolderDownloadPath" function of dataiku

Hi Team
I am trying to read an excel file from the managed folder in the dataiku which is of "Server's Filesystem" type and reading files from "filesystem_root".

folder_specs.pngNow, I am trying to read an excel file which is present in this managed folder using the below R code and getting an attached error. 

folder_name <- "DXbBXaww"

path_to_folder<- "/Input/app/"

data_path <- dkuManagedFolderDownloadPath(folder_name ,paste0(path_to_folder,"file_name.xlsx"))

data <- read.xlsx(data_path ,sheet ="model_applicability")

 

read_excel_error.png

0 Kudos
3 Replies
CatalinaS
Dataiker

Below is an example code that shows how to read an Excel file from a local managed folder:

library(dataiku)
library(xlsx)

folder_name <- "hRJwLbQS"
path <- dkuManagedFolderPath(folder_name)
data <- read.xlsx(paste0(path,"/xl2.xlsx"), sheetName="Sheet1")

print(data)

 

Screenshot 2023-09-18 at 19.32.22.png

 

0 Kudos
shashankmittal
Level 2
Author

Hi @CatalinaS 

Thanks for the response!

I have also tried with the solution which you have provided but getting an attached error and also I have verified the path which I am providing and its also looking fine.

excel_error_with_old_func.png

Please consider the below configuration of my managed folder.

Managed Folder Configuration:

- Managed Folder Type: Server's file system 

- Source: filesystem_root 

Thank you in advance for your attention to this issue. Please let me know if you require any additional information.

 

0 Kudos
CatalinaS
Dataiker

The error indicates that the file is not found at the location /data/dataiku/dss_data/config/projects/.../DS Module/Input/app.

You need to check if the path is correct and the Excel file exists at that location.

 

0 Kudos