Skip to content

Commit

Permalink
deprecation marks
Browse files Browse the repository at this point in the history
  • Loading branch information
dmivankov committed Oct 31, 2023
1 parent 9714621 commit e5e26b7
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/scala/cognite/spark/v1/DefaultSource.scala
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class DefaultSource
new SequenceRowsRelation(config, sequenceId)(sqlContext)
}

@deprecated("wdl support is deprecated", since = "0")
private def createWellDataLayer(
parameters: Map[String, String],
config: RelationConfig,
Expand Down Expand Up @@ -174,7 +175,7 @@ class DefaultSource
case FlexibleDataModelRelationFactory.ResourceType =>
createFlexibleDataModelRelation(parameters, config, sqlContext)
case "welldatalayer" =>
createWellDataLayer(parameters, config, sqlContext)
createWellDataLayer(parameters, config, sqlContext): @annotation.nowarn
case _ => sys.error("Unknown resource type: " + resourceType)
}
}
Expand Down Expand Up @@ -241,7 +242,7 @@ class DefaultSource
case FlexibleDataModelRelationFactory.ResourceType =>
createFlexibleDataModelRelation(parameters, config, sqlContext)
case "welldatalayer" =>
createWellDataLayer(parameters, config, sqlContext)
createWellDataLayer(parameters, config, sqlContext): @annotation.nowarn
case _ => sys.error(s"Resource type $resourceType does not support save()")
}
val batchSizeDefault = relation match {
Expand Down
4 changes: 4 additions & 0 deletions src/main/scala/cognite/spark/v1/wdl/WdlModels.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,28 @@ package cognite.spark.v1.wdl
import cognite.spark.v1.CdfSparkException
import io.circe.{Json, JsonObject}

@deprecated("wdl support is deprecated", since = "0")
case class WdlModel(
shortName: String,
ingest: Option[WdlIngestDefinition],
retrieve: WdlRetrieveDefinition
)

@deprecated("wdl support is deprecated", since = "0")
case class WdlIngestDefinition(
schemaName: String,
url: String
)

@deprecated("wdl support is deprecated", since = "0")
case class WdlRetrieveDefinition(
schemaName: String,
url: String,
isGet: Boolean = false,
transformBody: JsonObject => JsonObject = it => it
)

@deprecated("wdl support is deprecated", since = "0")
object WdlModels {
val models: Seq[WdlModel] = Seq(
WdlModel(
Expand Down
1 change: 1 addition & 0 deletions src/main/scala/cognite/spark/v1/wdl/WellDataLayerRDD.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import org.apache.spark.{Partition, SparkContext, TaskContext}

import scala.collection.AbstractIterator

@deprecated("wdl support is deprecated", since = "0")
class WellDataLayerRDD(
@transient override val sparkContext: SparkContext,
val schema: StructType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import org.apache.spark.sql.sources.TableScan
import org.apache.spark.sql.types.{DataType, StructType}
import org.apache.spark.sql.{Row, SQLContext}

@deprecated("wdl support is deprecated", since = "0")
class WellDataLayerRelation(
config: RelationConfig,
model: String
Expand Down
1 change: 1 addition & 0 deletions src/test/scala/cognite/spark/v1/wdl/WdlModelsTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cognite.spark.v1.wdl
import cognite.spark.v1.{CdfSparkException, SparkTest}
import org.scalatest.{FlatSpec, Matchers}

@deprecated("wdl support is deprecated", since = "0")
class WdlModelsTest extends FlatSpec with Matchers with SparkTest {
it should "get from ingestion name" in {
val wellSource = WdlModels.fromIngestionSchemaName("NptIngestion")
Expand Down

0 comments on commit e5e26b7

Please sign in to comment.