diff --git a/build.sbt b/build.sbt index 237d6a5..42b3315 100644 --- a/build.sbt +++ b/build.sbt @@ -3,8 +3,8 @@ ThisBuild / scalaVersion := "3.3.8" val fs2DataVersion = "1.8.1" val http4sVersion = "0.23.36" -val latisVersion = "b66ec47" -val latisHapiVersion = "1a507d1" +val latisVersion = "c1531e77" +val latisHapiVersion = "1d65ba50" lazy val root = (project in file(".")) .settings( diff --git a/src/main/scala/latis/ops/ConvertHapiTypes.scala b/src/main/scala/latis/ops/ConvertHapiTypes.scala index e0cf68d..b11a320 100644 --- a/src/main/scala/latis/ops/ConvertHapiTypes.scala +++ b/src/main/scala/latis/ops/ConvertHapiTypes.scala @@ -27,6 +27,7 @@ class ConvertHapiTypes extends MapOperation { private def convertValue(data: Data): Data = data match { case v: ShortValue => IntValue(v.value.toInt) + case v: LongValue => IntValue(v.value.toInt) //risk of overflow but no exception case v: FloatValue => DoubleValue(v.value.toDouble) case _ => data //no-op, shouldn't get here due to catalog filter } @@ -45,6 +46,10 @@ class ConvertHapiTypes extends MapOperation { Scalar.fromMetadata( scalar.metadata + ("type" -> "int") ).fold(throw _, identity) //should not fail + case LongValueType => + Scalar.fromMetadata( + scalar.metadata + ("type" -> "int") + ).fold(throw _, identity) //should not fail case _ => scalar //no-op, shouldn't get here due to catalog filter } } diff --git a/src/main/scala/latis/service/hapi/HapiService.scala b/src/main/scala/latis/service/hapi/HapiService.scala index 8a93310..e5fced1 100644 --- a/src/main/scala/latis/service/hapi/HapiService.scala +++ b/src/main/scala/latis/service/hapi/HapiService.scala @@ -42,7 +42,7 @@ class HapiService(catalog: Catalog) extends ServiceInterface(catalog, OperationR // This checks that: // - The Dataset metadata has temporalCoverage // - The single domain variable is of type Time - // - Each scalar in the range has a supported type + // - Each scalar in the range has a supported or convertible type // - If the type of a scalar is string, its size is defined private val filteredCatalog: Catalog = { val covP: Metadata => Boolean = _.getProperty("temporalCoverage").isDefined @@ -50,8 +50,9 @@ class HapiService(catalog: Catalog) extends ServiceInterface(catalog, OperationR case "string" => md.getProperty("size").isDefined case "double" => true case "int" => true - case "float" => true //may be converted to double by ConvertHapiTypes - case "short" => true //may be converted to int by ConvertHapiTypes + case "long" => true //converted to int by ConvertHapiTypes + case "float" => true //converted to double by ConvertHapiTypes + case "short" => true //converted to int by ConvertHapiTypes case _ => false }