[R-pkg-devel] Cryptic error on Windows but not Debian
Adam
@@eb@@dow@k| @end|ng |rom gm@||@com
Fri Nov 17 23:08:13 CET 2023
I pass on Debian but have an ERROR on Windows dev. version of R. I'm
confused for 2 reasons:
1. The example should not be running in the first place, as it has
@examplesIf megamation:::mm_has_creds(), which should be FALSE for CRAN (it
depends on env. variables)
2. I see the example printed twice with strange formatting?
Running examples in 'megamation-Ex.R' failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: mm_get
> ### Title: Get data
> ### Aliases: mm_get
>
> ### ** Examples
>
> ## Don't show:
> if (megamation:::mm_has_creds()) (if (getRversion() >= "3.4") withAutoprint else force)({ # examplesIf
+ ## End(Don't show)
+ # Get all work orders from Jan. 2023 containing trades ADMIN and IT:
+
+ # First create a Date-type vector
+ jan_2023 <- seq.Date(
+ as.Date("2023-01-01"),
+ as.Date("2023-01-31"),
+ by = "day"
+ )
+
+ # Then prefix the trade values with the "containing" modifier "[]"
+ # since trade is a list column in the work order table
+ admin_and_it <- c("[]ADMIN", "[]IT")
+
+ mm_get("workorder", date = jan_2023, trade = admin_and_it)
+ ## Don't show:
+ }) # examplesIf
> jan_2023 <- seq.Date(as.Date("2023-01-01"), as.Date("2023-01-31"), by = "day")
> admin_and_it <- c("[]ADMIN", "[]IT")
> mm_get("workorder", date = jan_2023, trade = admin_and_it)
Error in `req_perform()`:
! Failed to parse error body with method defined in `req_error()`.
Caused by error in `httr2::resp_body_json()`:
! Unexpected content type "text/html".
• Expecting type "application/json" or suffix "json".
Best,
Adam
[[alternative HTML version deleted]]
More information about the R-package-devel
mailing list