@@ -25,9 +25,7 @@ import org.locationtech.rasterframes.datasource.raster._
2525import org .locationtech .rasterframes .datasource .stac .api .encoders ._
2626import com .azavea .stac4s .StacItem
2727import com .azavea .stac4s .api .client .{SearchFilters , SttpStacClient }
28- import cats .syntax .option ._
2928import cats .effect .IO
30- import eu .timepit .refined .auto ._
3129import geotrellis .store .util .BlockingThreadPool
3230import org .apache .spark .sql .functions .explode
3331import org .locationtech .rasterframes .TestEnvironment
@@ -45,9 +43,10 @@ class StacApiDataSourceTest extends TestEnvironment { self =>
4543 .read
4644 .stacApi(
4745 " https://franklin.nasa-hsi.azavea.com/" ,
48- filters = SearchFilters (items = List (" aviris-l1-cogs_f130329t01p00r06_sc01" )),
49- searchLimit = Some (1 )
50- ).load
46+ filters = SearchFilters (items = List (" aviris-l1-cogs_f130329t01p00r06_sc01" ))
47+ )
48+ .load
49+ .limit(1 )
5150
5251 results.rdd.partitions.length shouldBe 1
5352 results.count() shouldBe 1L
@@ -78,9 +77,10 @@ class StacApiDataSourceTest extends TestEnvironment { self =>
7877 .read
7978 .stacApi(
8079 " https://franklin.nasa-hsi.azavea.com/" ,
81- filters = SearchFilters (items = List (" aviris-l1-cogs_f130329t01p00r06_sc01" )),
82- searchLimit = Some (1 )
83- ).load
80+ filters = SearchFilters (items = List (" aviris-l1-cogs_f130329t01p00r06_sc01" ))
81+ )
82+ .load
83+ .limit(1 )
8484
8585 results.rdd.partitions.length shouldBe 1
8686
@@ -118,10 +118,9 @@ class StacApiDataSourceTest extends TestEnvironment { self =>
118118 .read
119119 .stacApi(
120120 " https://franklin.nasa-hsi.azavea.com/" ,
121- filters = SearchFilters (items = List (" aviris-l1-cogs_f130329t01p00r06_sc01" )),
122- searchLimit = Some (1 )
121+ filters = SearchFilters (items = List (" aviris-l1-cogs_f130329t01p00r06_sc01" ))
123122 )
124- .loadStac
123+ .loadStac(limit = 1 ) // to preserve the STAC DataFrame type
125124
126125 val assets =
127126 items
@@ -149,7 +148,7 @@ class StacApiDataSourceTest extends TestEnvironment { self =>
149148 it(" should read from Astraea Earth service" ) {
150149 import spark .implicits ._
151150
152- val results = spark.read.stacApi(" https://eod-catalog-svc-prod.astraea.earth/" , searchLimit = Some ( 1 )) .load
151+ val results = spark.read.stacApi(" https://eod-catalog-svc-prod.astraea.earth/" ) .load.limit( 1 )
153152
154153 // results.printSchema()
155154
@@ -178,8 +177,9 @@ class StacApiDataSourceTest extends TestEnvironment { self =>
178177 val items =
179178 spark
180179 .read
181- .stacApi(" https://eod-catalog-svc-prod.astraea.earth/" , searchLimit = 1 .some )
180+ .stacApi(" https://eod-catalog-svc-prod.astraea.earth/" )
182181 .load
182+ .limit(1 )
183183
184184 println(items.collect().toList.length)
185185
@@ -199,7 +199,11 @@ class StacApiDataSourceTest extends TestEnvironment { self =>
199199
200200 ignore(" should fetch rasters from the Datacube STAC API service" ) {
201201 import spark .implicits ._
202- val items = spark.read.stacApi(" https://datacube.services.geo.ca/api" , filters = SearchFilters (collections= List (" markham" )), searchLimit = Some (1 )).load
202+ val items = spark
203+ .read
204+ .stacApi(" https://datacube.services.geo.ca/api" , filters = SearchFilters (collections= List (" markham" )))
205+ .load
206+ .limit(1 )
203207
204208 println(items.collect().toList.length)
205209
0 commit comments