Skip to content

Commit bf6af95

Browse files
1 parent 8f5396a commit bf6af95

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

‎bigframes/core/compile/sqlglot/expressions/binary_compiler.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ def _(op, left: TypedExpr, right: TypedExpr) -> sge.Expression:
9494
return sge.TimestampSub(
9595
this=left_expr, expression=right.expr, unit=sge.Var(this="MICROSECOND")
9696
)
97-
if (dtypes.is_time_or_date_like(left.dtype) and dtypes.is_time_or_date_like(right.dtype)):
97+
if dtypes.is_time_or_date_like(left.dtype) and dtypes.is_time_or_date_like(
98+
right.dtype
99+
):
98100
left_expr = left.expr
99101
if left.dtype == dtypes.DATE_DTYPE:
100102
left_expr = sge.Cast(this=left_expr, to="DATETIME")

‎tests/unit/core/compile/sqlglot/expressions/test_binary_compiler.py‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ def test_add_string(scalar_types_df: bpd.DataFrame, snapshot):
6161
snapshot.assert_match(sql, "out.sql")
6262

6363

64-
def test_add_timedelta(
65-
scalar_types_df: bpd.DataFrame, snapshot
66-
):
64+
def test_add_timedelta(scalar_types_df: bpd.DataFrame, snapshot):
6765
bf_df = scalar_types_df[["timestamp_col", "date_col"]]
6866
timedelta = pd.Timedelta(1, unit="d")
6967

@@ -105,9 +103,7 @@ def test_sub_numeric(scalar_types_df: bpd.DataFrame, snapshot):
105103
snapshot.assert_match(bf_df.sql, "out.sql")
106104

107105

108-
def test_sub_timedelta(
109-
scalar_types_df: bpd.DataFrame, snapshot
110-
):
106+
def test_sub_timedelta(scalar_types_df: bpd.DataFrame, snapshot):
111107
bf_df = scalar_types_df[["timestamp_col", "date_col"]]
112108
timedelta = pd.Timedelta(1, unit="d")
113109

0 commit comments

Comments
 (0)