Skip to content

Commit 1b0a0c8

Browse files
fix dt floor misuse
1 parent 69728a7 commit 1b0a0c8

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

tests/unit/core/compile/sqlglot/expressions/snapshots/test_unary_compiler/test_floor_dt/out.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ WITH `bfcte_0` AS (
55
), `bfcte_1` AS (
66
SELECT
77
*,
8-
TIMESTAMP_TRUNC(`bfcol_0`, DAY) AS `bfcol_1`
8+
TIMESTAMP_TRUNC(`bfcol_0`, D) AS `bfcol_1`
99
FROM `bfcte_0`
1010
)
1111
SELECT
1212
`bfcol_1` AS `timestamp_col`
13-
FROM `bfcte_1`
13+
FROM `bfcte_1`

tests/unit/core/compile/sqlglot/expressions/snapshots/test_unary_compiler/test_normalize/out.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ WITH `bfcte_0` AS (
55
), `bfcte_1` AS (
66
SELECT
77
*,
8-
TIMESTAMP_TRUNC(`bfcol_0`, DAY) AS `bfcol_1`
8+
TIMESTAMP_TRUNC(`bfcol_0`, D) AS `bfcol_1`
99
FROM `bfcte_0`
1010
)
1111
SELECT
1212
`bfcol_1` AS `timestamp_col`
13-
FROM `bfcte_1`
13+
FROM `bfcte_1`

tests/unit/core/compile/sqlglot/expressions/test_unary_compiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def test_expm1(scalar_types_df: bpd.DataFrame, snapshot):
153153

154154
def test_floor_dt(scalar_types_df: bpd.DataFrame, snapshot):
155155
bf_df = scalar_types_df[["timestamp_col"]]
156-
sql = _apply_unary_op(bf_df, ops.FloorDtOp("DAY"), "timestamp_col")
156+
sql = _apply_unary_op(bf_df, ops.FloorDtOp("D"), "timestamp_col")
157157

158158
snapshot.assert_match(sql, "out.sql")
159159

0 commit comments

Comments
 (0)