Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added TypedViewTest and renamed Expr.Column to Expr.Cell
- Loading branch information
Jacob Fischer
committed
Aug 27, 2020
1 parent
233d809
commit 80f60ae
Showing
10 changed files
with
41 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/test/scala/com/audienceproject/crossbow/core/TypedViewTest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.audienceproject.crossbow.core | ||
|
||
import com.audienceproject.crossbow.DataFrame | ||
import com.audienceproject.crossbow.Implicits._ | ||
import org.scalatest.funsuite.AnyFunSuite | ||
|
||
class TypedViewTest extends AnyFunSuite { | ||
|
||
private val df = DataFrame.fromSeq(Seq(("a", 1), ("b", 2), ("c", 3))) | ||
|
||
test("Cast DataFrame to TypedView of single type") { | ||
val result = df.select($"_0").as[String].toSeq | ||
val expected = Seq("a", "b", "c") | ||
assert(result == expected) | ||
} | ||
|
||
test("Cast DataFrame to TypedView of tuple") { | ||
val result = df.as[(String, Int)].toSeq | ||
val expected = Seq(("a", 1), ("b", 2), ("c", 3)) | ||
assert(result == expected) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters