Skip to content

Commit ee7be9a

Browse files
committed
update code comments
1 parent 83591f2 commit ee7be9a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bigframes/core/compile/sqlglot/expressions/date_ops.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ def _(expr: TypedExpr) -> sge.Expression:
6161

6262
# Helpers
6363
def dayofweek_op_impl(expr: TypedExpr) -> sge.Expression:
64-
# Adjust the 1-based day-of-week index (from SQL) to a 0-based index.
64+
# BigQuery SQL Extract(DAYOFWEEK) returns 1 for Sunday through 7 for Saturday.
65+
# We want 0 for Monday through 6 for Sunday to be compatible with Pandas.
6566
extract_expr = sge.Extract(
6667
this=sge.Identifier(this="DAYOFWEEK"), expression=expr.expr
6768
)

0 commit comments

Comments
 (0)