`s3_read` doesn't play nice with `openxlsx`
It seem that when trying to read an xlsx file with the openxlsx package doesn't work. botor::s3_read("s3://mybucket/example_file.xlsx", fun=openxlsx::read.xlsx) results in Error: openxlsx can only read .xlsx files
I can confirm that reading the file locally (openxlsx::read.xlsx("example_file.xlsx")) works fine. And readxl's read_xlsx also works with botor. I would probably prefer readxl over openxlsx anyway, but it would be useful to understand why these aren't working nicely together.
I believe this is because openxlsx checks for a file extension on the temp file. See also
https://github.com/ycphs/openxlsx/blob/47df27e6f4fdab4bd51bedb6123881781f00887b/R/readWorkbook.R#L123-L125
and
https://github.com/daroczig/botor/blob/8eb24fa7f0102fbc88d9941dc097cb4016c930e5/R/s3.R#L105