Skip to content

Commit

Permalink
Modified format and test case
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-sjayabalan committed Aug 20, 2024
1 parent 805320d commit 741b75c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2766,7 +2766,6 @@ public void any_value() {
}

@Test

public void reverse() {
DataFrame df = getSession().sql("select * from values('cat') as t(a)");
checkAnswer(df.select(Functions.reverse(df.col("a"))), new Row[] {Row.create("tac")}, false);
Expand Down Expand Up @@ -2949,5 +2948,4 @@ public void unbase64() {
Row[] expected = {Row.create("test")};
checkAnswer(df.select(Functions.unbase64(Functions.col("a"))), expected, false);
}

}
10 changes: 6 additions & 4 deletions src/test/scala/com/snowflake/snowpark_test/FunctionSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2329,13 +2329,15 @@ trait FunctionSuite extends TestData {
checkAnswer(data.select(reverse(col("a"))), Seq(Row("tac")), sort = false)
}

test("isnull") {
val data = Seq("1", null).toDF("a")
checkAnswer(data.select(isnull(col("a"))), Seq(Row(true), Row(false)), sort = false)
test("NaN and Null") {
checkAnswer(
nanData1.select(equal_nan(col("A")), isnull(col("A"))),
Seq(Row(false, false), Row(true, false), Row(null, true), Row(false, false)),
sort = false)
}

test("unix_timestamp") {
val data = Seq("2024-04-08T23:39:20.123-07:00").toDF("a")
val data = Seq(Timestamp.valueOf("2024-04-08T23:39:20.123-07:00")).toDF("a")
checkAnswer(data.select(unix_timestamp(col("a"))), Seq(Row("1712619560123")), sort = false)
}
}
Expand Down

0 comments on commit 741b75c

Please sign in to comment.