Skip to content

Commit 3c69a4d

Browse files
committed
snapshot again
1 parent 49f52c1 commit 3c69a4d

File tree

217 files changed

+1979
-2305
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

217 files changed

+1979
-2305
lines changed

bigframes/core/array_value.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,6 @@ def from_bq_data_source(
141141
)
142142
return cls(node)
143143

144-
@staticmethod
145-
def is_table_type_supported(table_type: Optional[str]):
146-
# Some external tables like those in GCS support all the features we want, such as time travel.
147-
return table_type in ("TABLE", "MATERIALIZED_VIEW", "EXTERNAL")
148-
149144
@property
150145
def column_ids(self) -> typing.Sequence[str]:
151146
"""Returns column ids as strings."""

bigframes/session/_io/bigquery/read_gbq_table.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import google.cloud.bigquery as bigquery
2929
import google.cloud.bigquery.table
3030

31+
import bigframes.core
3132
import bigframes.core.events
3233
import bigframes.exceptions as bfe
3334
import bigframes.session._io.bigquery

bigframes/session/loader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -709,9 +709,9 @@ def read_gbq_table(
709709
# the index is consistent with tables that have primary keys, even
710710
# when max_results is set.
711711
max_results is not None
712-
# Views such as INFORMATION_SCHEMA also introduce non-determinism.
712+
# Views such as INFORMATION_SCHEMA can introduce non-determinism.
713713
# They can update frequently and don't support time travel.
714-
or not core.ArrayValue.is_table_type_supported(table.table_type)
714+
or bf_read_gbq_table.is_information_schema(table_id)
715715
):
716716
# TODO(b/338111344): If we are running a query anyway, we might as
717717
# well generate ROW_NUMBER() at the same time.

tests/unit/core/compile/sqlglot/aggregations/snapshots/test_binary_compiler/test_corr/out.sql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
WITH `bfcte_0` AS (
22
SELECT
3-
*
4-
FROM UNNEST(ARRAY<STRUCT<`bfcol_0` INT64, `bfcol_1` FLOAT64>>[STRUCT(CAST(NULL AS INT64), CAST(NULL AS FLOAT64))])
3+
`int64_col` AS `bfcol_0`,
4+
`float64_col` AS `bfcol_1`
5+
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
56
), `bfcte_1` AS (
67
SELECT
78
CORR(`bfcol_0`, `bfcol_1`) AS `bfcol_2`

tests/unit/core/compile/sqlglot/aggregations/snapshots/test_binary_compiler/test_cov/out.sql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
WITH `bfcte_0` AS (
22
SELECT
3-
*
4-
FROM UNNEST(ARRAY<STRUCT<`bfcol_0` INT64, `bfcol_1` FLOAT64>>[STRUCT(CAST(NULL AS INT64), CAST(NULL AS FLOAT64))])
3+
`int64_col` AS `bfcol_0`,
4+
`float64_col` AS `bfcol_1`
5+
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
56
), `bfcte_1` AS (
67
SELECT
78
COVAR_SAMP(`bfcol_0`, `bfcol_1`) AS `bfcol_2`
Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
11
WITH `bfcte_0` AS (
22
SELECT
3-
*
4-
FROM UNNEST(ARRAY<STRUCT<`bfcol_0` BOOLEAN, `bfcol_1` INT64>>[STRUCT(CAST(NULL AS BOOLEAN), 0)])
3+
`bool_col` AS `bfcol_0`,
4+
`bytes_col` AS `bfcol_1`,
5+
`date_col` AS `bfcol_2`,
6+
`datetime_col` AS `bfcol_3`,
7+
`geography_col` AS `bfcol_4`,
8+
`int64_col` AS `bfcol_5`,
9+
`int64_too` AS `bfcol_6`,
10+
`numeric_col` AS `bfcol_7`,
11+
`float64_col` AS `bfcol_8`,
12+
`rowindex` AS `bfcol_9`,
13+
`rowindex_2` AS `bfcol_10`,
14+
`string_col` AS `bfcol_11`,
15+
`time_col` AS `bfcol_12`,
16+
`timestamp_col` AS `bfcol_13`,
17+
`duration_col` AS `bfcol_14`
18+
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
519
), `bfcte_1` AS (
620
SELECT
721
*,
8-
ROW_NUMBER() OVER (ORDER BY `bfcol_1` ASC NULLS LAST) AS `bfcol_3`
22+
ROW_NUMBER() OVER () AS `bfcol_32`
923
FROM `bfcte_0`
1024
)
1125
SELECT
12-
`bfcol_3` AS `row_number`
13-
FROM `bfcte_1`
14-
ORDER BY
15-
`bfcol_1` ASC NULLS LAST
26+
`bfcol_32` AS `row_number`
27+
FROM `bfcte_1`
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
WITH `bfcte_0` AS (
22
SELECT
3-
*
4-
FROM UNNEST(ARRAY<STRUCT<`bfcol_0` INT64, `bfcol_1` INT64>>[STRUCT(CAST(NULL AS INT64), 0)])
3+
`int64_col` AS `bfcol_0`
4+
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
55
), `bfcte_1` AS (
66
SELECT
77
*,
8-
ROW_NUMBER() OVER (ORDER BY `bfcol_0` ASC NULLS LAST, `bfcol_1` ASC NULLS LAST) AS `bfcol_2`
8+
ROW_NUMBER() OVER (ORDER BY `bfcol_0` ASC NULLS LAST) AS `bfcol_1`
99
FROM `bfcte_0`
1010
)
1111
SELECT
12-
`bfcol_2` AS `row_number`
13-
FROM `bfcte_1`
14-
ORDER BY
15-
`bfcol_1` ASC NULLS LAST
12+
`bfcol_1` AS `row_number`
13+
FROM `bfcte_1`

tests/unit/core/compile/sqlglot/aggregations/snapshots/test_nullary_compiler/test_size/out.sql

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
WITH `bfcte_0` AS (
22
SELECT
3-
*
4-
FROM UNNEST(ARRAY<STRUCT<`bfcol_0` BOOLEAN, `bfcol_1` BYTES, `bfcol_2` DATE, `bfcol_3` DATETIME, `bfcol_4` GEOGRAPHY, `bfcol_5` INT64, `bfcol_6` INT64, `bfcol_7` NUMERIC, `bfcol_8` FLOAT64, `bfcol_9` INT64, `bfcol_10` INT64, `bfcol_11` STRING, `bfcol_12` TIME, `bfcol_13` TIMESTAMP, `bfcol_14` INT64>>[STRUCT(
5-
CAST(NULL AS BOOLEAN),
6-
CAST(NULL AS BYTES),
7-
CAST(NULL AS DATE),
8-
CAST(NULL AS DATETIME),
9-
CAST(NULL AS GEOGRAPHY),
10-
CAST(NULL AS INT64),
11-
CAST(NULL AS INT64),
12-
CAST(NULL AS NUMERIC),
13-
CAST(NULL AS FLOAT64),
14-
CAST(NULL AS INT64),
15-
CAST(NULL AS INT64),
16-
CAST(NULL AS STRING),
17-
CAST(NULL AS TIME),
18-
CAST(NULL AS TIMESTAMP),
19-
CAST(NULL AS INT64)
20-
)])
3+
`bool_col` AS `bfcol_0`,
4+
`bytes_col` AS `bfcol_1`,
5+
`date_col` AS `bfcol_2`,
6+
`datetime_col` AS `bfcol_3`,
7+
`geography_col` AS `bfcol_4`,
8+
`int64_col` AS `bfcol_5`,
9+
`int64_too` AS `bfcol_6`,
10+
`numeric_col` AS `bfcol_7`,
11+
`float64_col` AS `bfcol_8`,
12+
`rowindex` AS `bfcol_9`,
13+
`rowindex_2` AS `bfcol_10`,
14+
`string_col` AS `bfcol_11`,
15+
`time_col` AS `bfcol_12`,
16+
`timestamp_col` AS `bfcol_13`,
17+
`duration_col` AS `bfcol_14`
18+
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
2119
), `bfcte_1` AS (
2220
SELECT
2321
COUNT(1) AS `bfcol_32`
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
WITH `bfcte_0` AS (
22
SELECT
3-
*
4-
FROM UNNEST(ARRAY<STRUCT<`bfcol_0` INT64, `bfcol_1` INT64>>[STRUCT(CAST(NULL AS INT64), 0)])
3+
`int64_col` AS `bfcol_0`
4+
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
55
), `bfcte_1` AS (
66
SELECT
7-
ARRAY_AGG(
8-
`bfcol_0` IGNORE NULLS ORDER BY `bfcol_0` IS NULL ASC, `bfcol_0` ASC, `bfcol_1` IS NULL ASC, `bfcol_1` ASC
9-
) AS `bfcol_2`
7+
ARRAY_AGG(`bfcol_0` IGNORE NULLS ORDER BY `bfcol_0` IS NULL ASC, `bfcol_0` ASC) AS `bfcol_1`
108
FROM `bfcte_0`
119
)
1210
SELECT
13-
`bfcol_2` AS `int64_col`
11+
`bfcol_1` AS `int64_col`
1412
FROM `bfcte_1`
Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
11
WITH `bfcte_0` AS (
22
SELECT
3-
*
4-
FROM UNNEST(ARRAY<STRUCT<`bfcol_0` STRING, `bfcol_1` INT64>>[STRUCT(CAST(NULL AS STRING), 0)])
3+
`string_col` AS `bfcol_0`
4+
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
55
), `bfcte_1` AS (
66
SELECT
7-
COALESCE(
8-
STRING_AGG(
9-
`bfcol_0`, ','
10-
ORDER BY
11-
`bfcol_0` IS NULL ASC,
12-
`bfcol_0` ASC,
13-
`bfcol_1` IS NULL ASC,
14-
`bfcol_1` ASC
15-
),
16-
''
17-
) AS `bfcol_2`
7+
COALESCE(STRING_AGG(`bfcol_0`, ','
8+
ORDER BY
9+
`bfcol_0` IS NULL ASC,
10+
`bfcol_0` ASC), '') AS `bfcol_1`
1811
FROM `bfcte_0`
1912
)
2013
SELECT
21-
`bfcol_2` AS `string_col`
14+
`bfcol_1` AS `string_col`
2215
FROM `bfcte_1`

0 commit comments

Comments
 (0)