Skip to content

Commit 1708e33

Browse files
update to_query tests
1 parent 564194a commit 1708e33

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

packages/bigframes/tests/unit/session/test_io_bigquery.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ def test_bq_schema_to_sql(schema: Iterable[bigquery.SchemaField], expected: str)
344344
2024, 5, 14, 12, 42, 36, 125125, tzinfo=datetime.timezone.utc
345345
),
346346
(
347-
"SELECT `row_index`, `string_col` FROM `test_table` "
347+
"SELECT `_bf_source`.`row_index`, `_bf_source`.`string_col` FROM `test_table` AS _bf_source "
348348
"FOR SYSTEM_TIME AS OF CAST('2024-05-14T12:42:36.125125+00:00' AS TIMESTAMP) "
349349
"WHERE `rowindex` NOT IN (0, 6) OR `string_col` IN ('Hello, World!', "
350350
"'こんにちは') LIMIT 123"
@@ -369,11 +369,11 @@ def test_bq_schema_to_sql(schema: Iterable[bigquery.SchemaField], expected: str)
369369
2024, 5, 14, 12, 42, 36, 125125, tzinfo=datetime.timezone.utc
370370
),
371371
(
372-
"""SELECT `rowindex`, `string_col` FROM (SELECT
372+
"""SELECT `_bf_source`.`rowindex`, `_bf_source`.`string_col` FROM (SELECT
373373
rowindex,
374374
string_col,
375375
FROM `test_table` AS t
376-
) """
376+
) AS _bf_source """
377377
"FOR SYSTEM_TIME AS OF CAST('2024-05-14T12:42:36.125125+00:00' AS TIMESTAMP) "
378378
"WHERE `rowindex` < 4 AND `string_col` = 'Hello, World!' "
379379
"LIMIT 123"
@@ -386,7 +386,7 @@ def test_bq_schema_to_sql(schema: Iterable[bigquery.SchemaField], expected: str)
386386
[],
387387
None, # max_results
388388
None, # time_travel_timestampe
389-
"SELECT `col_a`, `col_b` FROM `test_table`",
389+
"SELECT `_bf_source`.`col_a`, `_bf_source`.`col_b` FROM `test_table` AS _bf_source",
390390
id="table-columns",
391391
),
392392
pytest.param(
@@ -395,7 +395,7 @@ def test_bq_schema_to_sql(schema: Iterable[bigquery.SchemaField], expected: str)
395395
[("date_col", ">", "2022-10-20")],
396396
None, # max_results
397397
None, # time_travel_timestampe
398-
"SELECT * FROM `test_table` WHERE `date_col` > '2022-10-20'",
398+
"SELECT * FROM `test_table` AS _bf_source WHERE `date_col` > '2022-10-20'",
399399
id="table-filter",
400400
),
401401
pytest.param(
@@ -404,7 +404,7 @@ def test_bq_schema_to_sql(schema: Iterable[bigquery.SchemaField], expected: str)
404404
[],
405405
None, # max_results
406406
None, # time_travel_timestampe
407-
"SELECT * FROM `test_table*`",
407+
"SELECT * FROM `test_table*` AS _bf_source",
408408
id="wildcard-no_params",
409409
),
410410
pytest.param(
@@ -413,7 +413,7 @@ def test_bq_schema_to_sql(schema: Iterable[bigquery.SchemaField], expected: str)
413413
[("_TABLE_SUFFIX", ">", "2022-10-20")],
414414
None, # max_results
415415
None, # time_travel_timestampe
416-
"SELECT * FROM `test_table*` WHERE `_TABLE_SUFFIX` > '2022-10-20'",
416+
"SELECT * FROM `test_table*` AS _bf_source WHERE `_TABLE_SUFFIX` > '2022-10-20'",
417417
id="wildcard-filter",
418418
),
419419
],

0 commit comments

Comments
 (0)