Azure / Microsoft365R

R SDK for interacting with Microsoft 365 APIs
Other
308 stars 41 forks source link

load_dataframe method does not respect guess_max argument #191

Closed RPanczak closed 5 months ago

RPanczak commented 8 months ago

I've been trying to read csv file using load_dataframe method. readr package is installed. Manual specifes that:

You can supply other arguments to the parsing function via the ... argument.

I'm having an issue with the method not respecting guess_max argument. I tried with another argument (delim) and it works fine. Is there any way around it?

Thanks!

markram0001 commented 5 months ago

It seems it is not respecting other arguments too. I tried delim and that works too but I need col_select which does not seem to work

delabj commented 5 months ago

It looks like this might be a typo.

This line https://github.com/Azure/Microsoft365R/blob/299718f0457d1ee255ea693eb262a86b60013ecc/R/ms_drive_item.R#L433

should be like this

  readr::read_delim(con, delim=delim, ...) 
markram0001 commented 5 months ago

I see. So that explains why only delim gets passed. I'm not a strong programmer. Is there a way I can do a fix for this locally or do they have to fix it in an update?

delabj commented 5 months ago

You'll need to wait till they patch this unless you want to build your own version from the GitHub. I did open a pull request with my proposed change but given the last commit was 5 months ago and then it would need to be pushed to cran that may take a while.

markram0001 commented 5 months ago

I see. I'm looking for a quick fix as I'd like to use the function now. Is it difficult to build my own version of it in GitHub? Would it be just a matter of creating a copy of the existing package, making the edit and installing that package on my machine manually?

delabj commented 5 months ago

Basically! It's not too bad. You could always I think make that function in your script and overwrite the package version, but that's usually not advisable.

hongooi73 commented 5 months ago

This is now in the fix-load-dataframe branch

RPanczak commented 5 months ago

Many thanks for implementing that!