summaryrefslogtreecommitdiffstats
path: root/tests/dataframe
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-02-08 05:38:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-02-08 05:38:42 +0000
commitc66e4a33e1a07c439f03fe47f146a6c6482bf6df (patch)
treecfdf01111c063b3e50841695e6c2768833aea4dc /tests/dataframe
parentReleasing debian version 20.11.0-1. (diff)
downloadsqlglot-c66e4a33e1a07c439f03fe47f146a6c6482bf6df.tar.xz
sqlglot-c66e4a33e1a07c439f03fe47f146a6c6482bf6df.zip
Merging upstream version 21.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dataframe')
-rw-r--r--tests/dataframe/unit/test_functions.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/dataframe/unit/test_functions.py b/tests/dataframe/unit/test_functions.py
index c845441..24904b7 100644
--- a/tests/dataframe/unit/test_functions.py
+++ b/tests/dataframe/unit/test_functions.py
@@ -528,7 +528,7 @@ class TestFunctions(unittest.TestCase):
col = SF.first(SF.col("cola"))
self.assertEqual("FIRST(cola)", col.sql())
ignore_nulls = SF.first("cola", True)
- self.assertEqual("FIRST(cola, TRUE)", ignore_nulls.sql())
+ self.assertEqual("FIRST(cola) IGNORE NULLS", ignore_nulls.sql())
def test_grouping_id(self):
col_str = SF.grouping_id("cola", "colb")
@@ -562,7 +562,7 @@ class TestFunctions(unittest.TestCase):
col = SF.last(SF.col("cola"))
self.assertEqual("LAST(cola)", col.sql())
ignore_nulls = SF.last("cola", True)
- self.assertEqual("LAST(cola, TRUE)", ignore_nulls.sql())
+ self.assertEqual("LAST(cola) IGNORE NULLS", ignore_nulls.sql())
def test_monotonically_increasing_id(self):
col = SF.monotonically_increasing_id()
@@ -713,8 +713,10 @@ class TestFunctions(unittest.TestCase):
self.assertEqual("NTH_VALUE(cola, 3)", col.sql())
col_no_offset = SF.nth_value("cola")
self.assertEqual("NTH_VALUE(cola)", col_no_offset.sql())
- with self.assertRaises(NotImplementedError):
- SF.nth_value("cola", ignoreNulls=True)
+
+ self.assertEqual(
+ "NTH_VALUE(cola) IGNORE NULLS", SF.nth_value("cola", ignoreNulls=True).sql()
+ )
def test_ntile(self):
col = SF.ntile(2)