25
25
import bigframes .core .ordering
26
26
import bigframes .core .schema
27
27
28
- _STRICT_COMPILER = compiler .Compiler (strict = True )
29
-
30
28
31
29
class SQLCompiler :
32
- def __init__ (self , strict : bool = True ):
33
- self ._compiler = compiler .Compiler (strict = strict )
34
-
35
30
def compile (
36
31
self ,
37
32
node : bigframes .core .nodes .BigFrameNode ,
@@ -41,7 +36,7 @@ def compile(
41
36
) -> str :
42
37
"""Compile node into sql where rows are sorted with ORDER BY."""
43
38
# If we are ordering the query anyways, compiling the slice as a limit is probably a good idea.
44
- return self . _compiler .compile_sql (node , ordered = ordered , limit = limit )
39
+ return compiler .compile_sql (node , ordered = ordered , limit = limit )
45
40
46
41
def compile_raw (
47
42
self ,
@@ -50,16 +45,16 @@ def compile_raw(
50
45
str , Sequence [bigquery .SchemaField ], bigframes .core .ordering .RowOrdering
51
46
]:
52
47
"""Compile node into sql that exposes all columns, including hidden ordering-only columns."""
53
- return self . _compiler .compile_raw (node )
48
+ return compiler .compile_raw (node )
54
49
55
50
56
51
def test_only_ibis_inferred_schema (node : bigframes .core .nodes .BigFrameNode ):
57
52
"""Use only for testing paths to ensure ibis inferred schema does not diverge from bigframes inferred schema."""
58
53
import bigframes .core .schema
59
54
60
- node = _STRICT_COMPILER ._replace_unsupported_ops (node )
55
+ node = compiler ._replace_unsupported_ops (node )
61
56
node , _ = rewrite .pull_up_order (node , order_root = False )
62
- ir = _STRICT_COMPILER .compile_node (node )
57
+ ir = compiler .compile_node (node )
63
58
items = tuple (
64
59
bigframes .core .schema .SchemaItem (name , ir .get_column_type (ibis_id ))
65
60
for name , ibis_id in zip (node .schema .names , ir .column_ids )
0 commit comments