Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings in tests #156

Open
olivroy opened this issue Oct 3, 2023 · 0 comments
Open

Warnings in tests #156

olivroy opened this issue Oct 3, 2023 · 0 comments

Comments

@olivroy
Copy link
Contributor

olivroy commented Oct 3, 2023

devtools::load_all("~/rrr-forks/timetk/")
#> ℹ Loading timetk
#> Registered S3 method overwritten by 'quantmod':
#>   method            from
#>   as.zoo.data.frame zoo
library(dplyr, warn.conflicts = FALSE)
FB_tbl <- FANG %>%
    dplyr::filter(symbol == "FB")


# Number of tk_get_signature columns
n <- 29

test_xts <- FB_tbl %>%
    tk_xts(silent = TRUE)
test <- tk_augment_timeseries_signature(test_xts)
#> Warning in .check_tzones(e1, e2): 'tzone' attributes are inconsistent
str(test)
#> An xts object on 2013-01-02 / 2016-12-30 containing: 
#>   Data:    double [1008, 32]
#>   Columns: open, high, low, close, volume ... with 27 more columns
#>   Index:   Date [1008] (TZ: "UTC")
options(warn = 2)
traceback(tk_augment_timeseries_signature(test_xts))
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'as_date': (converted from warning) 'tzone' attributes are inconsistent

Created on 2023-10-03 with reprex v2.0.2

I added a expect_tz_warning() to make R CMD CHECK pass in the meantime. in #155

When this issue is fixed, we can delete expect_tz_warning() and replace all with expect_no_warning()

Edit: this warning is for R >= 4.3
https://cran.r-project.org/doc/manuals/r-release/NEWS.html

possibly relevant changes in R 4.3

  • On platforms where (non-UTC) datetimes before 1902 (or before 1900 as with system functions on recent macOS) are guessed by extrapolating time zones from 1902-2037, there is a warning at the first use of extrapolation in a session. (As all time zones post 2037 are extrapolation, we do not warn on those.)

  • (Platforms using --with-internal-tzone, including Windows and by default macOS). How years are printed in dates or date-times can be controlled by environment variable R_PAD_YEARS_BY_ZERO. The default remains to pad to 4 digits by zeroes, but setting value ‘⁠no⁠’ gives no padding (as used by default by glibc).

  • as.Date.POSIXct(., tz) now treats several tz values, notably "GMT" as equivalent to "UTC", proposed and improved by Michael Chirico and Joshua Ulrich in PR#17674.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant