dieghernan / tidyterra

tidyverse and ggplot2 methods for terra spatial objects

Home Page:https://dieghernan.github.io/tidyterra/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

summarise.sf raises an error if .by is given but no across() on the geometry

edzer opened this issue · comments

See here - upcoming sf now leads to the following error in tidyterra:

  Runningtestthat.RERROR
Running the tests intests/testthat.Rfailed.
Last 13 lines of output:
    'test-slice-SpatVector.R:163:3', 'test-slice-SpatVector.R:218:3',
    'test-slice-SpatVector.R:243:3', 'test-slice-SpatVector.R:357:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-as_sf.R:85:3'): Coercion to rowwise sf works with names creating groups ──
  Error in `summarise.sf(., a = dplyr::n())`: when using .by, also add across(geom, st_union) as argument
  Backtrace:1. ├─dplyr::rowwise(sf2, gr) %>% summarise(a = dplyr::n()) at test-as_sf.R:85:2
   2. ├─dplyr::summarise(., a = dplyr::n())
   3. └─sf:::summarise.sf(., a = dplyr::n())
  
  [ FAIL 1 | WARN 0 | SKIP 131 | PASS 1160 ]

Hi @edzer

I am just wondering...
Are you planning a new CRAN release soon and this can be a problem when revdepchecks?

Yes, I've got a

Please correct before 2024-01-10 to safely retain your package on CRAN.

and hope to get a version through before CRAN's holiday break.

I would just skip that test by now and try to send a new release to CRAN before Sunday

Hi @edzer

I released succesfully a new version of tidyterra (0.5.1), it is already on CRAN.

I skipped some tests by now so it does not interfere with your upcoming release of sf anymore when revdepcheck. I checked it locally with sf 1.0.15 with no errors, warnings, etc.

On top of that, I added an additional github action that checks tidyterra using the dev version sf weekly (see here). I already implemented this action for terra-devel to avoid this kind of situations, so hopefully now I can anticipate breaking changes and avoid delays on your work.

Let me know if there is anything else I can help with, regards

Great, thanks!

I see that sf has been updated on CRAN and checks on the latest release are not erroring due to this issue.

I guess this can be closed, thanks