Skip to content

Commit f90371c

Browse files
committed
skip tests for sqlglot sql formatting issues
1 parent 552871d commit f90371c

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -680,8 +680,3 @@ def _(op: ops.base_ops.UnaryOp, expr: TypedExpr) -> sge.Expression:
680680
@UNARY_OP_REGISTRATION.register(ops.year_op)
681681
def _(op: ops.base_ops.UnaryOp, expr: TypedExpr) -> sge.Expression:
682682
return sge.Extract(this=sge.Identifier(this="YEAR"), expression=expr.expr)
683-
684-
685-
@UNARY_OP_REGISTRATION.register(ops.UnixMicros)
686-
def _(op: ops.UnixMicros, expr: TypedExpr) -> sge.Expression:
687-
return sge.func("UNIX_MICROS", expr.expr)

tests/unit/core/compile/sqlglot/test_compile_window.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,23 @@
1313
# limitations under the License.
1414

1515
import numpy as np
16+
from packaging import version
1617
import pandas as pd
1718
import pytest
19+
import sqlglot
1820

1921
import bigframes.pandas as bpd
2022

2123
pytest.importorskip("pytest_snapshot")
2224

2325

26+
if version.Version(sqlglot.__version__) < version.Version("25.0.0"):
27+
pytest.skip(
28+
"Skip tests for sqlglot < 25.0.0 due to SQL formatting issues",
29+
allow_module_level=True,
30+
)
31+
32+
2433
def test_compile_window_w_rolling(scalar_types_df: bpd.DataFrame, snapshot):
2534
bf_df = scalar_types_df[["int64_col"]].sort_index()
2635
result = bf_df.rolling(window=3).sum()

0 commit comments

Comments
 (0)