Skip to content

Commit

Permalink
Ensure correct data type of NA timestamps
Browse files Browse the repository at this point in the history
Up until now, `get.data.cut.to.same.date(data.sources =
c("issues", "mails", "commits"))` failed if some of the first data
source was empty, but not if the second one was empty. The reason was
that `NA` values introduced by empty data sources at the beginning of
the data frame turned the data frame into a data frame of numeric
objects instead of POSIXct objects. If there were already POSIXct
objects in the data frame, this did not happen. To prevent the
timestamps to be interpreted as numeric values, make sure that the `NA`
values are always POSIXct objects.

This fixes se-sic#269.

Signed-off-by: Thomas Bock <[email protected]>
  • Loading branch information
bockthom authored and maxloeffler committed Oct 17, 2024
1 parent 34137e8 commit 10696e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions util-data.R
Original file line number Diff line number Diff line change
Expand Up @@ -797,8 +797,8 @@ ProjectData = R6::R6Class("ProjectData",
}
## NAs otherwise
else {
source.date.min = NA
source.date.max = NA
source.date.min = as.POSIXct(NA)
source.date.max = as.POSIXct(NA)
}

## remove old line if existing
Expand Down

0 comments on commit 10696e4

Please sign in to comment.