Skip to content

Commit f7089cc

Browse files
test(bigframes): Disable ibis fallback for system tests (#17333)
1 parent 6642263 commit f7089cc

26 files changed

Lines changed: 34 additions & 25 deletions

File tree

  • packages/bigframes
    • bigframes/core/compile/sqlglot/expressions
    • tests
      • system
      • unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops
        • test_ai_classify_multi_with_list_examples
        • test_ai_classify_with_output_mode
        • test_ai_classify_with_params
        • test_ai_classify
        • test_ai_generate_bool_with_connection_id
        • test_ai_generate_bool_with_model_param
        • test_ai_generate_bool
        • test_ai_generate_double_with_connection_id
        • test_ai_generate_double_with_model_param
        • test_ai_generate_double
        • test_ai_generate_int_with_connection_id
        • test_ai_generate_int_with_model_param
        • test_ai_generate_int
        • test_ai_generate_with_connection_id
        • test_ai_generate_with_model_param
        • test_ai_generate_with_output_schema
        • test_ai_generate
        • test_ai_if_with_endpoint
        • test_ai_if
        • test_ai_score_with_endpoint_and_max_error_ratio
        • test_ai_score

packages/bigframes/bigframes/core/compile/sqlglot/expressions/ai_ops.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ def _construct_prompt(
111111
else:
112112
prompt.append(sge.Literal.string(elem))
113113

114-
return sge.Kwarg(this=param_name, expression=sge.Tuple(expressions=prompt))
114+
# Need Struct rather than tuple syntax, as tuple syntax is ambiguous for single arg
115+
return sge.Kwarg(this=param_name, expression=sge.Struct(expressions=prompt))
115116

116117

117118
def _construct_named_args(op: ops.ScalarOp) -> list[sge.Kwarg]:

packages/bigframes/tests/system/conftest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,6 +1325,14 @@ def usa_names_grouped_table(
13251325
return session.bqclient.get_table(table_id)
13261326

13271327

1328+
@pytest.fixture(scope="session", autouse=True)
1329+
def use_sqlglot_compiler():
1330+
original_setting = bigframes.options.experiments.sql_compiler
1331+
bigframes.options.experiments.sql_compiler = "experimental"
1332+
yield
1333+
bigframes.options.experiments.sql_compiler = original_setting
1334+
1335+
13281336
@pytest.fixture()
13291337
def restore_sampling_settings():
13301338
enable_downsampling = bigframes.options.sampling.enable_downsampling
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
SELECT
2-
AI.CLASSIFY(input => (`string_col`), categories => ['greeting', 'rejection']) AS `result`
2+
AI.CLASSIFY(input => STRUCT(`string_col`), categories => ['greeting', 'rejection']) AS `result`
33
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types` AS `bft_0`

packages/bigframes/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_classify/bigframes-dev.us.bigframes-default-connection/out.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
SELECT
22
AI.CLASSIFY(
3-
input => (`string_col`),
3+
input => STRUCT(`string_col`),
44
categories => ['greeting', 'rejection'],
55
connection_id => 'bigframes-dev.us.bigframes-default-connection'
66
) AS `result`

packages/bigframes/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_classify_multi_with_list_examples/out.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
SELECT
22
AI.CLASSIFY(
3-
input => (`string_col`),
3+
input => STRUCT(`string_col`),
44
categories => ['greeting', 'rejection'],
55
examples => [('hi', ['greeting', 'positive']), ('bye', ['rejection', 'negative'])],
66
output_mode => 'multi'

packages/bigframes/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_classify_with_output_mode/out.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
SELECT
22
AI.CLASSIFY(
3-
input => (`string_col`),
3+
input => STRUCT(`string_col`),
44
categories => ['greeting', 'rejection'],
55
output_mode => 'multi'
66
) AS `result`

packages/bigframes/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_classify_with_params/out.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
SELECT
22
AI.CLASSIFY(
3-
input => (`string_col`),
3+
input => STRUCT(`string_col`),
44
categories => ['greeting', 'rejection'],
55
examples => [('hi', 'greeting'), ('bye', 'rejection')],
66
endpoint => 'gemini-2.5-flash',

packages/bigframes/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate/out.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
SELECT
22
AI.GENERATE(
3-
prompt => (`string_col`, ' is the same as ', `string_col`),
3+
prompt => STRUCT(`string_col`, ' is the same as ', `string_col`),
44
endpoint => 'gemini-2.5-flash',
55
request_type => 'SHARED'
66
) AS `result`
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
SELECT
22
AI.GENERATE_BOOL(
3-
prompt => (`string_col`, ' is the same as ', `string_col`),
3+
prompt => STRUCT(`string_col`, ' is the same as ', `string_col`),
44
endpoint => 'gemini-2.5-flash'
55
) AS `result`
66
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types` AS `bft_0`

packages/bigframes/tests/unit/core/compile/sqlglot/expressions/snapshots/test_ai_ops/test_ai_generate_bool_with_connection_id/out.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
SELECT
22
AI.GENERATE_BOOL(
3-
prompt => (`string_col`, ' is the same as ', `string_col`),
3+
prompt => STRUCT(`string_col`, ' is the same as ', `string_col`),
44
connection_id => 'bigframes-dev.us.bigframes-default-connection',
55
endpoint => 'gemini-2.5-flash'
66
) AS `result`

0 commit comments

Comments
 (0)