diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2023-12-10 10:45:55 +0000 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2023-12-10 10:45:55 +0000 |
commit | 02df6cdb000c8dbf739abda2af321a4f90d1b059 (patch) | |
tree | 2fc1daf848082ff67a11e60025cac260e3c318b2 /tests/dataframe | |
parent | Adding upstream version 19.0.1. (diff) | |
download | sqlglot-02df6cdb000c8dbf739abda2af321a4f90d1b059.tar.xz sqlglot-02df6cdb000c8dbf739abda2af321a4f90d1b059.zip |
Adding upstream version 20.1.0.upstream/20.1.0
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'tests/dataframe')
-rw-r--r-- | tests/dataframe/unit/test_column.py | 2 | ||||
-rw-r--r-- | tests/dataframe/unit/test_functions.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/dataframe/unit/test_column.py b/tests/dataframe/unit/test_column.py index 117789e..7a12808 100644 --- a/tests/dataframe/unit/test_column.py +++ b/tests/dataframe/unit/test_column.py @@ -146,7 +146,7 @@ class TestDataframeColumn(unittest.TestCase): self.assertEqual("cola BETWEEN 1 AND 3", F.col("cola").between(1, 3).sql()) self.assertEqual("cola BETWEEN 10.1 AND 12.1", F.col("cola").between(10.1, 12.1).sql()) self.assertEqual( - "cola BETWEEN TO_DATE('2022-01-01') AND TO_DATE('2022-03-01')", + "cola BETWEEN CAST('2022-01-01' AS DATE) AND CAST('2022-03-01' AS DATE)", F.col("cola").between(datetime.date(2022, 1, 1), datetime.date(2022, 3, 1)).sql(), ) self.assertEqual( diff --git a/tests/dataframe/unit/test_functions.py b/tests/dataframe/unit/test_functions.py index 586b8fc..54b327c 100644 --- a/tests/dataframe/unit/test_functions.py +++ b/tests/dataframe/unit/test_functions.py @@ -27,7 +27,7 @@ class TestFunctions(unittest.TestCase): test_null = SF.lit(None) self.assertEqual("NULL", test_null.sql()) test_date = SF.lit(datetime.date(2022, 1, 1)) - self.assertEqual("TO_DATE('2022-01-01')", test_date.sql()) + self.assertEqual("CAST('2022-01-01' AS DATE)", test_date.sql()) test_datetime = SF.lit(datetime.datetime(2022, 1, 1, 1, 1, 1)) self.assertEqual("CAST('2022-01-01T01:01:01+00:00' AS TIMESTAMP)", test_datetime.sql()) test_dict = SF.lit({"cola": 1, "colb": "test"}) @@ -49,7 +49,7 @@ class TestFunctions(unittest.TestCase): test_array = SF.col([1, 2, "3"]) self.assertEqual("ARRAY(1, 2, '3')", test_array.sql()) test_date = SF.col(datetime.date(2022, 1, 1)) - self.assertEqual("TO_DATE('2022-01-01')", test_date.sql()) + self.assertEqual("CAST('2022-01-01' AS DATE)", test_date.sql()) test_datetime = SF.col(datetime.datetime(2022, 1, 1, 1, 1, 1)) self.assertEqual("CAST('2022-01-01T01:01:01+00:00' AS TIMESTAMP)", test_datetime.sql()) test_dict = SF.col({"cola": 1, "colb": "test"}) |