Skip to content

Commit 4b6aff0

Browse files
committed
[review] Expand revision count limit from 1000 to 10000 entries
1 parent 3e43695 commit 4b6aff0

5 files changed

Lines changed: 17 additions & 10 deletions

File tree

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: dv.listings
22
Type: Package
33
Title: Data listings module
4-
Version: 4.3.4-9003
4+
Version: 4.3.4-9004
55
Authors@R:
66
c(
77
person("Boehringer-Ingelheim Pharma GmbH & Co.KG", role = c("cph", "fnd")),

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# dv.listings 4.3.4-9004
2+
- Review functionality:
3+
- Expand revision count limit from 1000 to 10000 entries
4+
15
# dv.listings 4.3.4-9003
26
- Review functionality:
37
- Guard against problematic characters in dataset names

R/review.R

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,10 @@ REV_load_annotation_info <- function(folder_contents, review, dataset_lists) {
259259

260260
base_timestamp <- NA_real_
261261
data_timestamps_st <- rep(NA_real_, row_count)
262-
# <domain>_000.base
263-
file_path <- file.path(dataset_lists_name, paste0(dataset_review_name, "_000.base"))
264-
if (file_path %in% names(folder_contents)) {
265-
contents <- folder_contents[[file_path]]
262+
# <domain>_0000.base
263+
base_file_path <- file.path(dataset_lists_name, paste0(dataset_review_name, "_0000.base"))
264+
if (base_file_path %in% names(folder_contents)) {
265+
contents <- folder_contents[[base_file_path]]
266266

267267
sorted_delta_file_paths <- local({
268268
pattern <- sprintf("^%s_[0-9]*.delta", file.path(dataset_lists_name, dataset_review_name))
@@ -383,7 +383,10 @@ REV_load_annotation_info <- function(folder_contents, review, dataset_lists) {
383383
base_info <- RS_load(contents, deltas)
384384

385385
delta_number <- length(sorted_delta_file_paths) + 1
386-
file_path <- file.path(dataset_lists_name, sprintf("%s_%03d.delta", dataset_review_name, delta_number))
386+
revision_digit_count <- nchar(sub(".*_(0+)\\.base$", "\\1", base_file_path))
387+
file_path <- file.path(
388+
dataset_lists_name, sprintf("%s_%.*d.delta", dataset_review_name, revision_digit_count, delta_number)
389+
)
387390
append_IO_action(list(kind = "write", path = file_path, contents = new_delta_contents, offset = 0L))
388391
}
389392
}
@@ -394,7 +397,7 @@ REV_load_annotation_info <- function(folder_contents, review, dataset_lists) {
394397
return(list(error = c(error, contents[["message"]])))
395398
} else {
396399
base_info <- RS_load(base = contents, deltas = list())
397-
append_IO_action(list(kind = "write", path = file_path, contents = contents, offset = 0L))
400+
append_IO_action(list(kind = "write", path = base_file_path, contents = contents, offset = 0L))
398401
}
399402
}
400403

tests/testthat/test-review.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ local({
4444
expect_length(info[["IO_plan"]], 1)
4545
folder_op <- info[["IO_plan"]][[1]]
4646
expect_equal(folder_op[["kind"]], "write")
47-
expect_equal(folder_op[["path"]], "dataset_list/ae_001.delta")
47+
expect_equal(folder_op[["path"]], "dataset_list/ae_0001.delta")
4848
expect_equal(folder_op[["offset"]], 0L)
4949

5050
delta <- RS_parse_delta(info[["IO_plan"]][[1]][["contents"]], length(tracked_vars))

vignettes/data_review.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ Lastly, using plain file storage allows for easy local testing and for universal
157157

158158
If we take a hypothetical "xyz" domain, `dv.listings` will store the following files for review purposes (expand to see the layout of their contents):
159159

160-
<details><summary>`xyz_000.base` (information related to the first version of the "xyz" domain dataset seen by the module)</summary>
160+
<details><summary>`xyz_0000.base` (information related to the first version of the "xyz" domain dataset seen by the module)</summary>
161161
- 1 file magic code ("LISTBASE")
162162
- 1 format version number (0)
163163
- 1 generation marker (0)
@@ -173,7 +173,7 @@ If we take a hypothetical "xyz" domain, `dv.listings` will store the following f
173173
- p (1 per "xyz" row, 2\*m bytes long) `hash_tracked(xyz[tracked_vars])`
174174
</details>
175175

176-
<details><summary>`xyz_001.delta` (one per domain dataset update)</summary>
176+
<details><summary>`xyz_0001.delta` (one per domain dataset update)</summary>
177177
- 1 file magic code ("LISTDELT")
178178
- 1 format version number (0)
179179
- 1 generation marker (1). Wraps around to 0 after 255 (e.g. for `xyz_256.delta`)

0 commit comments

Comments
 (0)