From 8791ef73ad993974154841aabf1d4b8e9c26fbc8 Mon Sep 17 00:00:00 2001 From: "milos.colic" Date: Mon, 15 Jan 2024 19:00:06 +0000 Subject: [PATCH] Fix formatting issues. --- python/mosaic/api/raster.py | 4 +++- .../labs/mosaic/functions/MosaicContext.scala | 24 +++++++++---------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/python/mosaic/api/raster.py b/python/mosaic/api/raster.py index d27f669bc..b191ba8d5 100644 --- a/python/mosaic/api/raster.py +++ b/python/mosaic/api/raster.py @@ -927,7 +927,9 @@ def rst_fromcontent(raster: ColumnOrName, driver: ColumnOrName, sizeInMB: Column """ return config.mosaic_context.invoke_function( - "rst_fromcontent", pyspark_to_java_column(raster), pyspark_to_java_column(driver), + "rst_fromcontent", + pyspark_to_java_column(raster), + pyspark_to_java_column(driver), pyspark_to_java_column(sizeInMB) ) diff --git a/src/main/scala/com/databricks/labs/mosaic/functions/MosaicContext.scala b/src/main/scala/com/databricks/labs/mosaic/functions/MosaicContext.scala index fd1dd176b..cd516ecc5 100644 --- a/src/main/scala/com/databricks/labs/mosaic/functions/MosaicContext.scala +++ b/src/main/scala/com/databricks/labs/mosaic/functions/MosaicContext.scala @@ -711,16 +711,15 @@ class MosaicContext(indexSystem: IndexSystem, geometryAPI: GeometryAPI) extends ColumnAdapter(RST_Tessellate(raster.expr, resolution.expr, expressionConfig)) def rst_tessellate(raster: Column, resolution: Int): Column = ColumnAdapter(RST_Tessellate(raster.expr, lit(resolution).expr, expressionConfig)) - def rst_fromcontent(raster: Column, driver:Column): Column = + def rst_fromcontent(raster: Column, driver: Column): Column = ColumnAdapter(RST_FromContent(raster.expr, driver.expr, lit(-1).expr, expressionConfig)) - def rst_fromcontent(raster: Column, driver:Column, sizeInMB:Column): Column = + def rst_fromcontent(raster: Column, driver: Column, sizeInMB: Column): Column = ColumnAdapter(RST_FromContent(raster.expr, driver.expr, sizeInMB.expr, expressionConfig)) - def rst_fromcontent(raster: Column, driver:String): Column = + def rst_fromcontent(raster: Column, driver: String): Column = ColumnAdapter(RST_FromContent(raster.expr, lit(driver).expr, lit(-1).expr, expressionConfig)) - def rst_fromcontent(raster: Column, driver:String, sizeInMB:Int): Column = + def rst_fromcontent(raster: Column, driver: String, sizeInMB: Int): Column = ColumnAdapter(RST_FromContent(raster.expr, lit(driver).expr, lit(sizeInMB).expr, expressionConfig)) - def rst_fromfile(raster: Column): Column = - ColumnAdapter(RST_FromFile(raster.expr, lit(-1).expr, expressionConfig)) + def rst_fromfile(raster: Column): Column = ColumnAdapter(RST_FromFile(raster.expr, lit(-1).expr, expressionConfig)) def rst_fromfile(raster: Column, sizeInMB: Column): Column = ColumnAdapter(RST_FromFile(raster.expr, sizeInMB.expr, expressionConfig)) def rst_fromfile(raster: Column, sizeInMB: Int): Column = @@ -1015,11 +1014,12 @@ object MosaicContext extends Logging { val isML = sparkVersion.contains("-ml-") val isPhoton = sparkVersion.contains("-photon-") - val isTest = ( - dbrMajor == 0 - && !spark.conf.getAll.exists(_._1.startsWith("spark.databricks.clusterUsageTags.")) - ) - + val isTest = + ( + dbrMajor == 0 + && !spark.conf.getAll.exists(_._1.startsWith("spark.databricks.clusterUsageTags.")) + ) + if (dbrMajor != 13 && !isTest) { val msg = """|DEPRECATION ERROR: | Mosaic v0.4.x series only supports Databricks Runtime 13. @@ -1039,7 +1039,7 @@ object MosaicContext extends Logging { logError(msg) println(msg) throw new Exception(msg) - } + } true }