Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow columns with types on empty dataframes
- Loading branch information
Johs Kristoffersen
committed
Feb 2, 2021
1 parent
57f037c
commit 86bfe4e
Showing
2 changed files
with
16 additions
and
6 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
13 changes: 13 additions & 0 deletions
13
src/test/scala/com/audienceproject/crossbow/core/ConstuctionTest.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,13 @@ | ||
package com.audienceproject.crossbow.core | ||
|
||
import com.audienceproject.crossbow.{DataFrame, expr} | ||
import com.audienceproject.crossbow.schema.{Column, Schema} | ||
import org.scalatest.funsuite.AnyFunSuite | ||
|
||
class ConstuctionTest extends AnyFunSuite { | ||
test("construct from typed empty seq") { | ||
val df = DataFrame.fromSeq(Seq.empty[(Int,Long)]) | ||
assertResult(2)(df.numColumns) | ||
assertResult(Schema(Seq(Column("_0",expr.IntType),Column("_1",expr.LongType))))(df.schema) | ||
} | ||
} |