Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit 446440d

Browse files
authored
Merge branch 'main' into shuowei-blob-null
2 parents ff8c6b7 + dc46b3c commit 446440d

14 files changed

Lines changed: 356 additions & 32 deletions

File tree

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@
44

55
[1]: https://pypi.org/project/bigframes/#history
66

7+
## [2.27.0](https://github.com/googleapis/python-bigquery-dataframes/compare/v2.26.0...v2.27.0) (2025-10-24)
8+
9+
10+
### Features
11+
12+
* Add __abs__ to dataframe ([#2186](https://github.com/googleapis/python-bigquery-dataframes/issues/2186)) ([c331dfe](https://github.com/googleapis/python-bigquery-dataframes/commit/c331dfed59174962fbdc8ace175dd00fcc3d5d50))
13+
* Add df.groupby().corr()/cov() support ([#2190](https://github.com/googleapis/python-bigquery-dataframes/issues/2190)) ([ccd7c07](https://github.com/googleapis/python-bigquery-dataframes/commit/ccd7c0774a65d09e6cf31d2b62d0bc64bd7c4248))
14+
* Add str accessor to index ([#2179](https://github.com/googleapis/python-bigquery-dataframes/issues/2179)) ([cd87ce0](https://github.com/googleapis/python-bigquery-dataframes/commit/cd87ce0d504747f44d1b5a55f869a2e0fca6df17))
15+
* Add support for `np.isnan` and `np.isfinite` ufuncs ([#2188](https://github.com/googleapis/python-bigquery-dataframes/issues/2188)) ([68723bc](https://github.com/googleapis/python-bigquery-dataframes/commit/68723bc1f08013e43a8b11752f908bf8fd6d51f5))
16+
* Include local data bytes in the dry run report when available ([#2185](https://github.com/googleapis/python-bigquery-dataframes/issues/2185)) ([ee2c40c](https://github.com/googleapis/python-bigquery-dataframes/commit/ee2c40c6789535e259fb6a9774831d6913d16212))
17+
* Support len() on Groupby objects ([#2183](https://github.com/googleapis/python-bigquery-dataframes/issues/2183)) ([4191821](https://github.com/googleapis/python-bigquery-dataframes/commit/4191821b0976281a96c8965336ef51f061b0c481))
18+
* Support pa.json_(pa.string()) in struct/list if available ([#2180](https://github.com/googleapis/python-bigquery-dataframes/issues/2180)) ([5ec3cc0](https://github.com/googleapis/python-bigquery-dataframes/commit/5ec3cc0298c7a6195d5bd12a08d996e7df57fc5f))
19+
20+
21+
### Documentation
22+
23+
* Update AI operators deprecation notice ([#2182](https://github.com/googleapis/python-bigquery-dataframes/issues/2182)) ([2c50310](https://github.com/googleapis/python-bigquery-dataframes/commit/2c503107e17c59232b14b0d7bc40c350bb087d6f))
24+
725
## [2.26.0](https://github.com/googleapis/python-bigquery-dataframes/compare/v2.25.0...v2.26.0) (2025-10-17)
826

927

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ def _(expr: TypedExpr) -> sge.Expression:
7676
@register_unary_op(ops.invert_op)
7777
def _(expr: TypedExpr) -> sge.Expression:
7878
if expr.dtype == dtypes.BOOL_DTYPE:
79-
return sge.Not(this=expr.expr)
80-
return sge.BitwiseNot(this=expr.expr)
79+
return sge.Not(this=sge.paren(expr.expr))
80+
return sge.BitwiseNot(this=sge.paren(expr.expr))
8181

8282

8383
@register_unary_op(ops.isnull_op)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def _(expr: TypedExpr) -> sge.Expression:
190190

191191
@register_unary_op(ops.neg_op)
192192
def _(expr: TypedExpr) -> sge.Expression:
193-
return sge.Neg(this=expr.expr)
193+
return sge.Neg(this=sge.paren(expr.expr))
194194

195195

196196
@register_unary_op(ops.pos_op)

bigframes/version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
__version__ = "2.26.0"
15+
__version__ = "2.27.0"
1616

1717
# {x-release-please-start-date}
18-
__release_date__ = "2025-10-17"
18+
__release_date__ = "2025-10-24"
1919
# {x-release-please-end}

tests/system/small/engines/test_generic_ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ def test_engines_isin_op(scalars_array_value: array_value.ArrayValue, engine):
454454
assert_equivalence_execution(arr.node, REFERENCE_ENGINE, engine)
455455

456456

457-
@pytest.mark.parametrize("engine", ["polars", "bq"], indirect=True)
457+
@pytest.mark.parametrize("engine", ["polars", "bq", "bq-sqlglot"], indirect=True)
458458
def test_engines_isin_op_nested_filter(
459459
scalars_array_value: array_value.ArrayValue, engine
460460
):

tests/unit/core/compile/sqlglot/expressions/snapshots/test_generic_ops/test_invert/out.sql

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,15 @@ WITH `bfcte_0` AS (
77
), `bfcte_1` AS (
88
SELECT
99
*,
10-
~`bfcol_2` AS `bfcol_6`,
11-
~`bfcol_1` AS `bfcol_7`,
12-
NOT `bfcol_0` AS `bfcol_8`
10+
~(
11+
`bfcol_2`
12+
) AS `bfcol_6`,
13+
~(
14+
`bfcol_1`
15+
) AS `bfcol_7`,
16+
NOT (
17+
`bfcol_0`
18+
) AS `bfcol_8`
1319
FROM `bfcte_0`
1420
)
1521
SELECT
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
WITH `bfcte_0` AS (
2+
SELECT
3+
`string_col` AS `bfcol_0`
4+
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
5+
), `bfcte_1` AS (
6+
SELECT
7+
*,
8+
CONCAT(`bfcol_0`, 'a') AS `bfcol_1`
9+
FROM `bfcte_0`
10+
)
11+
SELECT
12+
`bfcol_1` AS `string_col`
13+
FROM `bfcte_1`
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
WITH `bfcte_0` AS (
2+
SELECT
3+
`date_col` AS `bfcol_0`,
4+
`rowindex` AS `bfcol_1`,
5+
`timestamp_col` AS `bfcol_2`
6+
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
7+
), `bfcte_1` AS (
8+
SELECT
9+
*,
10+
`bfcol_1` AS `bfcol_6`,
11+
`bfcol_2` AS `bfcol_7`,
12+
`bfcol_0` AS `bfcol_8`,
13+
TIMESTAMP_ADD(CAST(`bfcol_0` AS DATETIME), INTERVAL 86400000000 MICROSECOND) AS `bfcol_9`
14+
FROM `bfcte_0`
15+
), `bfcte_2` AS (
16+
SELECT
17+
*,
18+
`bfcol_6` AS `bfcol_14`,
19+
`bfcol_7` AS `bfcol_15`,
20+
`bfcol_8` AS `bfcol_16`,
21+
`bfcol_9` AS `bfcol_17`,
22+
TIMESTAMP_ADD(`bfcol_7`, INTERVAL 86400000000 MICROSECOND) AS `bfcol_18`
23+
FROM `bfcte_1`
24+
), `bfcte_3` AS (
25+
SELECT
26+
*,
27+
`bfcol_14` AS `bfcol_24`,
28+
`bfcol_15` AS `bfcol_25`,
29+
`bfcol_16` AS `bfcol_26`,
30+
`bfcol_17` AS `bfcol_27`,
31+
`bfcol_18` AS `bfcol_28`,
32+
TIMESTAMP_ADD(CAST(`bfcol_16` AS DATETIME), INTERVAL 86400000000 MICROSECOND) AS `bfcol_29`
33+
FROM `bfcte_2`
34+
), `bfcte_4` AS (
35+
SELECT
36+
*,
37+
`bfcol_24` AS `bfcol_36`,
38+
`bfcol_25` AS `bfcol_37`,
39+
`bfcol_26` AS `bfcol_38`,
40+
`bfcol_27` AS `bfcol_39`,
41+
`bfcol_28` AS `bfcol_40`,
42+
`bfcol_29` AS `bfcol_41`,
43+
TIMESTAMP_ADD(`bfcol_25`, INTERVAL 86400000000 MICROSECOND) AS `bfcol_42`
44+
FROM `bfcte_3`
45+
), `bfcte_5` AS (
46+
SELECT
47+
*,
48+
172800000000 AS `bfcol_50`
49+
FROM `bfcte_4`
50+
)
51+
SELECT
52+
`bfcol_36` AS `rowindex`,
53+
`bfcol_37` AS `timestamp_col`,
54+
`bfcol_38` AS `date_col`,
55+
`bfcol_39` AS `date_add_timedelta`,
56+
`bfcol_40` AS `timestamp_add_timedelta`,
57+
`bfcol_41` AS `timedelta_add_date`,
58+
`bfcol_42` AS `timedelta_add_timestamp`,
59+
`bfcol_50` AS `timedelta_add_timedelta`
60+
FROM `bfcte_5`

tests/unit/core/compile/sqlglot/expressions/snapshots/test_numeric_ops/test_mod_numeric/out.sql

Lines changed: 60 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,43 @@ WITH `bfcte_0` AS (
3838
`bfcol_8` AS `bfcol_16`,
3939
`bfcol_9` AS `bfcol_17`,
4040
CASE
41-
WHEN -`bfcol_7` = CAST(0 AS INT64)
41+
WHEN -(
42+
`bfcol_7`
43+
) = CAST(0 AS INT64)
4244
THEN CAST(0 AS INT64) * `bfcol_7`
43-
WHEN -`bfcol_7` < CAST(0 AS INT64)
45+
WHEN -(
46+
`bfcol_7`
47+
) < CAST(0 AS INT64)
4448
AND (
45-
MOD(`bfcol_7`, -`bfcol_7`)
49+
MOD(`bfcol_7`, -(
50+
`bfcol_7`
51+
))
4652
) > CAST(0 AS INT64)
47-
THEN -`bfcol_7` + (
48-
MOD(`bfcol_7`, -`bfcol_7`)
53+
THEN -(
54+
`bfcol_7`
55+
) + (
56+
MOD(`bfcol_7`, -(
57+
`bfcol_7`
58+
))
4959
)
50-
WHEN -`bfcol_7` > CAST(0 AS INT64)
60+
WHEN -(
61+
`bfcol_7`
62+
) > CAST(0 AS INT64)
5163
AND (
52-
MOD(`bfcol_7`, -`bfcol_7`)
64+
MOD(`bfcol_7`, -(
65+
`bfcol_7`
66+
))
5367
) < CAST(0 AS INT64)
54-
THEN -`bfcol_7` + (
55-
MOD(`bfcol_7`, -`bfcol_7`)
68+
THEN -(
69+
`bfcol_7`
70+
) + (
71+
MOD(`bfcol_7`, -(
72+
`bfcol_7`
73+
))
5674
)
57-
ELSE MOD(`bfcol_7`, -`bfcol_7`)
75+
ELSE MOD(`bfcol_7`, -(
76+
`bfcol_7`
77+
))
5878
END AS `bfcol_18`
5979
FROM `bfcte_1`
6080
), `bfcte_3` AS (
@@ -152,23 +172,43 @@ WITH `bfcte_0` AS (
152172
`bfcol_56` AS `bfcol_72`,
153173
`bfcol_57` AS `bfcol_73`,
154174
CASE
155-
WHEN CAST(-`bfcol_52` AS BIGNUMERIC) = CAST(0 AS INT64)
175+
WHEN CAST(-(
176+
`bfcol_52`
177+
) AS BIGNUMERIC) = CAST(0 AS INT64)
156178
THEN CAST('NaN' AS FLOAT64) * CAST(`bfcol_52` AS BIGNUMERIC)
157-
WHEN CAST(-`bfcol_52` AS BIGNUMERIC) < CAST(0 AS INT64)
179+
WHEN CAST(-(
180+
`bfcol_52`
181+
) AS BIGNUMERIC) < CAST(0 AS INT64)
158182
AND (
159-
MOD(CAST(`bfcol_52` AS BIGNUMERIC), CAST(-`bfcol_52` AS BIGNUMERIC))
183+
MOD(CAST(`bfcol_52` AS BIGNUMERIC), CAST(-(
184+
`bfcol_52`
185+
) AS BIGNUMERIC))
160186
) > CAST(0 AS INT64)
161-
THEN CAST(-`bfcol_52` AS BIGNUMERIC) + (
162-
MOD(CAST(`bfcol_52` AS BIGNUMERIC), CAST(-`bfcol_52` AS BIGNUMERIC))
187+
THEN CAST(-(
188+
`bfcol_52`
189+
) AS BIGNUMERIC) + (
190+
MOD(CAST(`bfcol_52` AS BIGNUMERIC), CAST(-(
191+
`bfcol_52`
192+
) AS BIGNUMERIC))
163193
)
164-
WHEN CAST(-`bfcol_52` AS BIGNUMERIC) > CAST(0 AS INT64)
194+
WHEN CAST(-(
195+
`bfcol_52`
196+
) AS BIGNUMERIC) > CAST(0 AS INT64)
165197
AND (
166-
MOD(CAST(`bfcol_52` AS BIGNUMERIC), CAST(-`bfcol_52` AS BIGNUMERIC))
198+
MOD(CAST(`bfcol_52` AS BIGNUMERIC), CAST(-(
199+
`bfcol_52`
200+
) AS BIGNUMERIC))
167201
) < CAST(0 AS INT64)
168-
THEN CAST(-`bfcol_52` AS BIGNUMERIC) + (
169-
MOD(CAST(`bfcol_52` AS BIGNUMERIC), CAST(-`bfcol_52` AS BIGNUMERIC))
202+
THEN CAST(-(
203+
`bfcol_52`
204+
) AS BIGNUMERIC) + (
205+
MOD(CAST(`bfcol_52` AS BIGNUMERIC), CAST(-(
206+
`bfcol_52`
207+
) AS BIGNUMERIC))
170208
)
171-
ELSE MOD(CAST(`bfcol_52` AS BIGNUMERIC), CAST(-`bfcol_52` AS BIGNUMERIC))
209+
ELSE MOD(CAST(`bfcol_52` AS BIGNUMERIC), CAST(-(
210+
`bfcol_52`
211+
) AS BIGNUMERIC))
172212
END AS `bfcol_74`
173213
FROM `bfcte_5`
174214
), `bfcte_7` AS (
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
WITH `bfcte_0` AS (
2+
SELECT
3+
`int64_col` AS `bfcol_0`,
4+
`rowindex` AS `bfcol_1`,
5+
`timestamp_col` AS `bfcol_2`,
6+
`duration_col` AS `bfcol_3`
7+
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
8+
), `bfcte_1` AS (
9+
SELECT
10+
*,
11+
`bfcol_1` AS `bfcol_8`,
12+
`bfcol_2` AS `bfcol_9`,
13+
`bfcol_0` AS `bfcol_10`,
14+
`bfcol_3` AS `bfcol_11`
15+
FROM `bfcte_0`
16+
), `bfcte_2` AS (
17+
SELECT
18+
*,
19+
`bfcol_8` AS `bfcol_16`,
20+
`bfcol_9` AS `bfcol_17`,
21+
`bfcol_10` AS `bfcol_18`,
22+
`bfcol_11` AS `bfcol_19`,
23+
CAST(FLOOR(`bfcol_11` * `bfcol_10`) AS INT64) AS `bfcol_20`
24+
FROM `bfcte_1`
25+
), `bfcte_3` AS (
26+
SELECT
27+
*,
28+
`bfcol_16` AS `bfcol_26`,
29+
`bfcol_17` AS `bfcol_27`,
30+
`bfcol_18` AS `bfcol_28`,
31+
`bfcol_19` AS `bfcol_29`,
32+
`bfcol_20` AS `bfcol_30`,
33+
CAST(FLOOR(`bfcol_18` * `bfcol_19`) AS INT64) AS `bfcol_31`
34+
FROM `bfcte_2`
35+
)
36+
SELECT
37+
`bfcol_26` AS `rowindex`,
38+
`bfcol_27` AS `timestamp_col`,
39+
`bfcol_28` AS `int64_col`,
40+
`bfcol_29` AS `duration_col`,
41+
`bfcol_30` AS `timedelta_mul_numeric`,
42+
`bfcol_31` AS `numeric_mul_timedelta`
43+
FROM `bfcte_3`

0 commit comments

Comments
 (0)