Skip to content

Commit

Permalink
Fix raster tests in R.
Browse files Browse the repository at this point in the history
  • Loading branch information
milos.colic committed Feb 13, 2024
1 parent 6a79482 commit 32d6f76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ test_that("raster flatmap functions behave as intended", {
tessellate_sdf <- withColumn(tessellate_sdf, "rst_tessellate", rst_tessellate(column("tile"), lit(3L)))

expect_no_error(write.df(tessellate_sdf, source = "noop", mode = "overwrite"))
expect_equal(nrow(tessellate_sdf), 140)
expect_equal(nrow(tessellate_sdf), 66)

overlap_sdf <- generate_singleband_raster_df()
overlap_sdf <- withColumn(overlap_sdf, "rst_to_overlapping_tiles", rst_to_overlapping_tiles(column("tile"), lit(200L), lit(200L), lit(10L)))

expect_no_error(write.df(overlap_sdf, source = "noop", mode = "overwrite"))
expect_equal(nrow(overlap_sdf), 196)
expect_equal(nrow(overlap_sdf), 87)
})

test_that("raster aggregation functions behave as intended", {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ test_that("raster flatmap functions behave as intended", {
mutate(rst_tessellate = rst_tessellate(tile, 3L))

expect_no_error(spark_write_source(tessellate_sdf, "noop", mode = "overwrite"))
expect_equal(sdf_nrow(tessellate_sdf), 140)
expect_equal(sdf_nrow(tessellate_sdf), 66)

overlap_sdf <- generate_singleband_raster_df() %>%
mutate(rst_to_overlapping_tiles = rst_to_overlapping_tiles(tile, 200L, 200L, 10L))

expect_no_error(spark_write_source(overlap_sdf, "noop", mode = "overwrite"))
expect_equal(sdf_nrow(overlap_sdf), 196)
expect_equal(sdf_nrow(overlap_sdf), 87)

})

Expand Down

0 comments on commit 32d6f76

Please sign in to comment.