Skip to content

Commit 5dec790

Browse files
committed
fix naming
1 parent f9bb9dc commit 5dec790

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sqlglot/dialects/duckdb.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2453,11 +2453,11 @@ def hexstring_sql(
24532453

24542454
def datetrunc_sql(self, expression: exp.DateTrunc) -> str:
24552455
unit = unit_to_str(expression)
2456-
timestamp = expression.this
2457-
result = self.func("DATE_TRUNC", unit, timestamp)
2456+
date = expression.this
2457+
result = self.func("DATE_TRUNC", unit, date)
24582458

2459-
if expression.args.get("cast_to_granularity_type") and timestamp.type:
2460-
return self.sql(exp.Cast(this=result, to=timestamp.type))
2459+
if expression.args.get("cast_to_granularity_type") and date.type:
2460+
return self.sql(exp.Cast(this=result, to=date.type))
24612461
return result
24622462

24632463
def timestamptrunc_sql(self, expression: exp.TimestampTrunc) -> str:

0 commit comments

Comments
 (0)