diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 025e83eb2..e3a3bbb71 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -19,11 +19,12 @@ object Dependencies { val scalaz7 = "7.0.9" val json4s = "3.2.11" // evicted by iglu-core with 3.3.0 val igluClient = "0.5.0" - val igluCore = "0.1.0" - val scalaTracker = "0.3.0" - val circeYaml = "0.6.1" - val circe = "0.8.0" - val cats = "0.9.0" + val igluCore = "0.2.0" + val scalaTracker = "0.5.0" + val circeYaml = "0.8.0" + val circe = "0.9.3" + val cats = "1.1.0" + val manifest = "0.1.0-M1" // Scala (Shredder) val spark = "2.2.0" diff --git a/src/main/scala/com/snowplowanalytics/snowplow/rdbloader/config/CliConfig.scala b/src/main/scala/com/snowplowanalytics/snowplow/rdbloader/config/CliConfig.scala index 2f8453319..8d39c0e15 100644 --- a/src/main/scala/com/snowplowanalytics/snowplow/rdbloader/config/CliConfig.scala +++ b/src/main/scala/com/snowplowanalytics/snowplow/rdbloader/config/CliConfig.scala @@ -13,6 +13,7 @@ package com.snowplowanalytics.snowplow.rdbloader package config +import cats._ import cats.data._ import cats.implicits._ @@ -140,7 +141,7 @@ object CliConfig { val steps = Step.constructSteps(rawConfig.skip.toSet, rawConfig.include.toSet) val folder = rawConfig.folder.map(f => S3.Folder.parse(f).leftMap(DecodingError).toValidatedNel).sequence - (target |@| config |@| logkey |@| folder).map { + (target, config, logkey, folder).mapN { case (t, c, l, f) => CliConfig(c, t, steps, l, f, rawConfig.dryRun) } } @@ -167,14 +168,15 @@ object CliConfig { * @param resolverConfigB64 base64-encoded Iglu resolver config * @param targetConfigB64 base64-encoded storage target JSON * @return either aggregated list of errors (from both resolver and target) - * or successfuly decoded storage target + * or successfully decoded storage target */ private def loadTarget(resolverConfigB64: String, targetConfigB64: String) = { val json = base64decode(resolverConfigB64).flatMap(Common.safeParse).toValidatedNel val resolver = json.andThen(Compat.convertIgluResolver) val decodedTarget = base64decode(targetConfigB64).toValidatedNel - (resolver |@| decodedTarget).tupled.andThen { - case (r, t) => StorageTarget.parseTarget(r, t) - } + + Semigroupal[ValidatedNel[ConfigError, ?]] // Very disappointed tupled syntax didn't work + .product(resolver, decodedTarget) + .andThen { case (r, t) => StorageTarget.parseTarget(r, t) } } } diff --git a/src/main/scala/com/snowplowanalytics/snowplow/rdbloader/config/SnowplowConfig.scala b/src/main/scala/com/snowplowanalytics/snowplow/rdbloader/config/SnowplowConfig.scala index 80cc3c627..3c5227ede 100644 --- a/src/main/scala/com/snowplowanalytics/snowplow/rdbloader/config/SnowplowConfig.scala +++ b/src/main/scala/com/snowplowanalytics/snowplow/rdbloader/config/SnowplowConfig.scala @@ -128,7 +128,7 @@ object SnowplowConfig { * Codecs should be declared in exact this order (reverse of their appearence in class) */ private implicit val decoderConfiguration = - Configuration.default.withSnakeCaseKeys + Configuration.default.withSnakeCaseMemberNames implicit val decodeTrackerMethod: Decoder[TrackerMethod] = decodeStringEnum[TrackerMethod] diff --git a/src/main/scala/com/snowplowanalytics/snowplow/rdbloader/package.scala b/src/main/scala/com/snowplowanalytics/snowplow/rdbloader/package.scala index 56de850eb..5bb5fc132 100644 --- a/src/main/scala/com/snowplowanalytics/snowplow/rdbloader/package.scala +++ b/src/main/scala/com/snowplowanalytics/snowplow/rdbloader/package.scala @@ -38,10 +38,10 @@ package object rdbloader { /** Lift value into */ object LoaderAction { def unit: LoaderAction[Unit] = - EitherT.liftT(Free.pure(())) + EitherT.liftF(Free.pure(())) def lift[A](value: A): LoaderAction[A] = - EitherT.liftT(Free.pure(value)) + EitherT.liftF(Free.pure(value)) def liftE[A](either: Either[LoaderError, A]): LoaderAction[A] = EitherT(Free.pure(either))