fix list_blobs bug with azcopy (fixes #52)

This commit is contained in:
Hong Ooi 2020-06-09 23:58:24 +10:00
Родитель 6e22a028e9
Коммит 94ba062e2b
4 изменённых файлов: 12 добавлений и 2 удалений

Просмотреть файл

@ -1,6 +1,6 @@
Package: AzureStor
Title: Storage Management in 'Azure'
Version: 3.2.1
Version: 3.2.1.9000
Authors@R: c(
person("Hong", "Ooi", , "hongooi@microsoft.com", role = c("aut", "cre")),
person("Microsoft", role="cph")

Просмотреть файл

@ -1,3 +1,7 @@
# AzureStor 3.2.1.9000
- Fix bug where `list_blobs()` returns incorrect `isdir` field for files uploaded with azcopy.
# AzureStor 3.2.1
- Internal changes to handle differences in how table storage returns error messages.

Просмотреть файл

@ -354,7 +354,7 @@ list_blobs <- function(container, dir="/", info=c("partial", "name", "all"),
# needed when dir was created using ADLS API
# this works because content-type is always set for an actual file
df$isdir <- is.na(df$LeaseState) | is.na(df$`Content-Type`)
df$isdir <- is.na(df$`Content-Type`)
df$size[df$isdir] <- NA
dircol <- which(names(df) == "isdir")

Просмотреть файл

@ -70,6 +70,8 @@ test_that("azcopy works with service token",
storage_upload(cont, "../resources/iris.csv", "iris.csv", use_azcopy=TRUE)
storage_download(cont, "iris.csv", destname, use_azcopy=TRUE)
expect_true(files_identical("../resources/iris.csv", destname))
flist <- list_storage_files(cont)
expect_false(flist$isdir[1])
})
@ -81,6 +83,8 @@ test_that("azcopy works with user token",
storage_upload(cont, "../resources/iris.csv", "iris.csv", use_azcopy=TRUE)
storage_download(cont, "iris.csv", destname, use_azcopy=TRUE)
expect_true(files_identical("../resources/iris.csv", destname))
flist <- list_storage_files(cont)
expect_false(flist$isdir[1])
})
@ -92,6 +96,8 @@ test_that("azcopy works with sas",
storage_upload(cont, "../resources/iris.csv", "iris.csv", use_azcopy=TRUE)
storage_download(cont, "iris.csv", destname, use_azcopy=TRUE)
expect_true(files_identical("../resources/iris.csv", destname))
flist <- list_storage_files(cont)
expect_false(flist$isdir[1])
})