Skip to content

Commit d567689

Browse files
committed
Fixed regressions.
1 parent 942ab50 commit d567689

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

core/src/test/scala/org/locationtech/rasterframes/functions/AggregateFunctionsSpec.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,10 @@ class AggregateFunctionsSpec extends TestEnvironment with RasterMatchers {
114114
.toDF("tile")
115115
.withColumn("id", monotonically_increasing_id())
116116

117-
df.select(rf_agg_local_mean($"tile")).first() should be(three.toArrayTile())
117+
val expected = three.toArrayTile().convert(DoubleConstantNoDataCellType)
118+
df.select(rf_agg_local_mean($"tile")).first() should be(expected)
118119

119-
df.selectExpr("rf_agg_local_mean(tile)").as[Tile].first() should be(three.toArrayTile())
120+
df.selectExpr("rf_agg_local_mean(tile)").as[Tile].first() should be(expected)
120121

121122
noException should be thrownBy {
122123
df.groupBy($"id")
@@ -139,7 +140,8 @@ class AggregateFunctionsSpec extends TestEnvironment with RasterMatchers {
139140
val t2 = df.selectExpr("rf_agg_local_no_data_cells(tile) as cnt").select($"cnt".as[Tile]).first()
140141
t1 should be(t2)
141142
val t3 = df.select(rf_local_add(rf_agg_local_data_cells($"tile"), rf_agg_local_no_data_cells($"tile"))).as[Tile].first()
142-
t3 should be(three.toArrayTile())
143+
val expected = three.toArrayTile().convert(IntConstantNoDataCellType)
144+
t3 should be(expected)
143145
checkDocs("rf_agg_local_no_data_cells")
144146
}
145147
}

core/src/test/scala/org/locationtech/rasterframes/functions/ArithmeticFunctionsSpec.scala renamed to core/src/test/scala/org/locationtech/rasterframes/functions/LocalFunctionsSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import org.apache.spark.sql.functions._
2929
import org.locationtech.rasterframes.expressions.accessors.ExtractTile
3030
import org.locationtech.rasterframes.tiles.ProjectedRasterTile
3131
import org.locationtech.rasterframes._
32-
class ArithmeticFunctionsSpec extends TestEnvironment with RasterMatchers {
32+
class LocalFunctionsSpec extends TestEnvironment with RasterMatchers {
3333

3434
import TestData._
3535
import spark.implicits._

core/src/test/scala/org/locationtech/rasterframes/functions/TileFunctionsSpec.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import javax.imageio.ImageIO
2929
import org.apache.spark.sql.Encoders
3030
import org.apache.spark.sql.functions.sum
3131
import org.locationtech.rasterframes._
32+
import org.locationtech.rasterframes.ref.RasterRef
3233
import org.locationtech.rasterframes.tiles.ProjectedRasterTile
3334
import org.locationtech.rasterframes.util.ColorRampNames
3435

@@ -235,14 +236,15 @@ class TileFunctionsSpec extends TestEnvironment with RasterMatchers {
235236
g should be(extent.toPolygon())
236237
checkDocs("rf_geometry")
237238
}
239+
implicit val enc = Encoders.tuple(Encoders.scalaInt, RasterRef.rrEncoder)
238240

239241
it("should get the CRS of a RasterRef") {
240-
val e = Seq(Tuple1(TestData.rasterRef)).toDF("ref").select(rf_crs($"ref")).first()
242+
val e = Seq((1, TestData.rasterRef)).toDF("index", "ref").select(rf_crs($"ref")).first()
241243
e should be(rasterRef.crs)
242244
}
243245

244246
it("should get the Extent of a RasterRef") {
245-
val e = Seq(Tuple1(rasterRef)).toDF("ref").select(rf_extent($"ref")).first()
247+
val e = Seq((1, rasterRef)).toDF("index", "ref").select(rf_extent($"ref")).first()
246248
e should be(rasterRef.extent)
247249
}
248250
}

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.3.4
1+
sbt.version=1.3.7

0 commit comments

Comments
 (0)