Permalink
Browse files

69.0.6: Correct Equal[ShiftedRead[A]]

(Merge branch 'alissapajer-equal-shiftedread')
  • Loading branch information...
jsantos17 committed Sep 21, 2018
2 parents 793f902 + 1b7e5b5 commit 4e6fdc3c0f9983c4292ad3a60896f5d07c3a5257
@@ -16,23 +16,23 @@
package quasar.qscript
import slamdata.Predef._
import quasar.fp._
import slamdata.Predef.List
import quasar.RenderTree
import quasar.contrib.pathy.APath
import matryoshka._
import monocle.macros.Lenses
import pathy.Path._
import scalaz._, Scalaz._
import pathy.Path.posixCodec
import scalaz.{Equal, Show}
import scalaz.syntax.std.option._
// TODO: Abstract Read over the backend’s preferred path representation.
/** A backend-resolved `Root`, which is now a path. */
@Lenses final case class Read[A](path: A)
object Read {
implicit def equal[A: Equal]: Equal[Read[A]] = Equal.equalBy(_.path)
implicit def show[A <: APath]: Show[Read[A]] = RenderTree.toShow
implicit def renderTree[A <: APath]: RenderTree[Read[A]] =
RenderTree.simple(List("Read"), r => posixCodec.printPath(r.path).some)
implicit def show[A <: APath]: Show[Read[A]] = RenderTree.toShow
}
@@ -16,15 +16,16 @@
package quasar.qscript
import slamdata.Predef._
import slamdata.Predef.List
import quasar.RenderTree
import quasar.contrib.pathy.APath
import quasar.fp._
import matryoshka._
import monocle.macros.Lenses
import pathy.Path._
import scalaz._, Scalaz._
import pathy.Path.posixCodec
import scalaz.{Equal, Show}
import scalaz.std.tuple._
import scalaz.syntax.show._
import scalaz.syntax.std.option._
/** Similar to [[Read]], but returns a dataset with an entry for each record. If
* `idStatus` is [[IncludeId]], then it returns a two-element array for each
@@ -34,8 +35,11 @@ import scalaz._, Scalaz._
@Lenses final case class ShiftedRead[A](path: A, idStatus: IdStatus)
object ShiftedRead {
implicit def equal[A: Equal]: Equal[ShiftedRead[A]] = Equal.equalBy(_.path)
implicit def equal[A: Equal]: Equal[ShiftedRead[A]] =
Equal.equalBy((sr => (sr.path, sr.idStatus)))
implicit def show[A <: APath]: Show[ShiftedRead[A]] = RenderTree.toShow
implicit def renderTree[A <: APath]: RenderTree[ShiftedRead[A]] =
RenderTree.simple(List("ShiftedRead"), r => {
(posixCodec.printPath(r.path) + ", " + r.idStatus.shows).some
@@ -50,7 +50,7 @@ class ShiftReadSpec extends quasar.Qspec with QScriptHelpers with TreeMatchers {
newQScript must
beTreeEqual(
qstdsl.fix.Map(
qstdsl.fix.ShiftedRead[AFile](sampleFile, ExcludeId),
qstdsl.fix.ShiftedRead[AFile](sampleFile, IncludeId),
qstdsl.recFunc.ProjectIndexI(qstdsl.recFunc.Hole, 1)))
}
View
@@ -1 +1 @@
version in ThisBuild := "69.0.5"
version in ThisBuild := "69.0.6"

0 comments on commit 4e6fdc3

Please sign in to comment.