jsonlite icon indicating copy to clipboard operation
jsonlite copied to clipboard

Issue with class scalar and vctrs

Open deann88 opened this issue 4 years ago • 1 comments

I stumbled into this issue with vctrs package

> list(
+   tibble(a = "chr", b = 2, d = jsonlite:::as.scalar(22)), 
+   tibble(b = 3, c = TRUE)
+ ) %>% 
+   bind_rows()
Error: Can't combine `..1` <scalar> and `..2` <vctrs:::common_class_fallback>.
Run `rlang::last_error()` to see where the error occurred.

The issues is mentioned here.

Then, I also found this one, and I am posting it here due to the error message in vcrs

> list(
+   tibble(a = "chr", b = 2, d = jsonlite:::as.scalar(NA)), 
+   tibble(b = 3, c = TRUE, d = jsonlite:::as.scalar("myCharacter"))
+ ) %>% 
+   bind_rows()
Error: Can't combine `..1$d` <scalar> and `..2$d` <scalar>.
x Some attributes are incompatible.
ℹ The author of the class should implement vctrs methods.
ℹ See <https://vctrs.r-lib.org/reference/faq-error-incompatible-attributes.html>.
Run `rlang::last_error()` to see where the error occurred.

deann88 avatar Jun 12 '20 20:06 deann88

This seems an error in vctrs/tibble? I don't know what I could do about this in jsonlite.

jeroen avatar Jun 13 '20 12:06 jeroen