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

Commit 1186b52

Browse files
Merge branch 'main' into more_hybrid_nodes
2 parents 44e360d + 8d46c36 commit 1186b52

21 files changed

Lines changed: 209 additions & 125 deletions

File tree

bigframes/core/compile/scalar_op_compiler.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -487,9 +487,9 @@ def isalpha_op_impl(x: ibis_types.Value):
487487

488488
@scalar_op_compiler.register_unary_op(ops.isdigit_op)
489489
def isdigit_op_impl(x: ibis_types.Value):
490-
# Based on docs, should include superscript/subscript-ed numbers
491-
# Tests however pass only when set to Nd unicode class
492-
return typing.cast(ibis_types.StringValue, x).re_search(r"^(\p{Nd})+$")
490+
return typing.cast(ibis_types.StringValue, x).re_search(
491+
r"^[\p{Nd}\x{00B9}\x{00B2}\x{00B3}\x{2070}\x{2074}-\x{2079}\x{2080}-\x{2089}]+$"
492+
)
493493

494494

495495
@scalar_op_compiler.register_unary_op(ops.isdecimal_op)

tests/system/large/functions/test_remote_function.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1707,7 +1707,7 @@ def analyze(row):
17071707
{
17081708
"dtype": row.dtype,
17091709
"count": row.count(),
1710-
"min": row.max(),
1710+
"min": row.min(),
17111711
"max": row.max(),
17121712
"mean": row.mean(),
17131713
"std": row.std(),

tests/system/small/operations/test_strings.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -324,13 +324,10 @@ def test_isalpha(weird_strings, weird_strings_pd):
324324
)
325325

326326

327-
@pytest.mark.skipif(
328-
"dev" in pa.__version__,
329-
# b/333484335 pyarrow is inconsistent on the behavior
330-
reason="pyarrow dev version is inconsistent on isdigit behavior.",
331-
)
332327
def test_isdigit(weird_strings, weird_strings_pd):
333-
pd_result = weird_strings_pd.str.isdigit()
328+
# check the behavior against normal pandas str, since pyarrow has a bug with superscripts/fractions b/333484335
329+
# astype object instead of str to support pd.NA
330+
pd_result = weird_strings_pd.astype(object).str.isdigit()
334331
bf_result = weird_strings.str.isdigit().to_pandas()
335332

336333
pd.testing.assert_series_equal(
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
WITH `bfcte_0` AS (
22
SELECT
3-
`int64_col` AS `bfcol_0`,
4-
`rowindex` AS `bfcol_1`
3+
`int64_col` AS `bfcol_0`
54
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
65
), `bfcte_1` AS (
76
SELECT
87
*,
9-
`bfcol_1` AS `bfcol_4`,
10-
`bfcol_0` + `bfcol_0` AS `bfcol_5`
8+
`bfcol_0` + `bfcol_0` AS `bfcol_1`
119
FROM `bfcte_0`
1210
)
1311
SELECT
14-
`bfcol_4` AS `rowindex`,
15-
`bfcol_5` AS `int64_col`
12+
`bfcol_1` AS `int64_col`
1613
FROM `bfcte_1`
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
WITH `bfcte_0` AS (
22
SELECT
3-
`int64_col` AS `bfcol_0`,
4-
`rowindex` AS `bfcol_1`
3+
`int64_col` AS `bfcol_0`
54
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
65
), `bfcte_1` AS (
76
SELECT
87
*,
9-
`bfcol_1` AS `bfcol_4`,
10-
`bfcol_0` + 1 AS `bfcol_5`
8+
`bfcol_0` + 1 AS `bfcol_1`
119
FROM `bfcte_0`
1210
)
1311
SELECT
14-
`bfcol_4` AS `rowindex`,
15-
`bfcol_5` AS `int64_col`
12+
`bfcol_1` AS `int64_col`
1613
FROM `bfcte_1`
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
WITH `bfcte_0` AS (
22
SELECT
3-
`rowindex` AS `bfcol_0`,
4-
`string_col` AS `bfcol_1`
3+
`string_col` AS `bfcol_0`
54
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
65
), `bfcte_1` AS (
76
SELECT
87
*,
9-
`bfcol_0` AS `bfcol_4`,
10-
CONCAT(`bfcol_1`, 'a') AS `bfcol_5`
8+
CONCAT(`bfcol_0`, 'a') AS `bfcol_1`
119
FROM `bfcte_0`
1210
)
1311
SELECT
14-
`bfcol_4` AS `rowindex`,
15-
`bfcol_5` AS `string_col`
12+
`bfcol_1` AS `string_col`
1613
FROM `bfcte_1`
Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
11
WITH `bfcte_0` AS (
22
SELECT
3-
`rowindex` AS `bfcol_0`,
4-
`json_col` AS `bfcol_1`
3+
`json_col` AS `bfcol_0`
54
FROM `bigframes-dev`.`sqlglot_test`.`json_types`
65
), `bfcte_1` AS (
76
SELECT
87
*,
9-
JSON_SET(`bfcol_1`, '$.a', 100) AS `bfcol_4`
8+
JSON_SET(`bfcol_0`, '$.a', 100) AS `bfcol_1`
109
FROM `bfcte_0`
11-
), `bfcte_2` AS (
12-
SELECT
13-
*,
14-
JSON_SET(`bfcol_4`, '$.b', 'hi') AS `bfcol_7`
15-
FROM `bfcte_1`
1610
)
1711
SELECT
18-
`bfcol_0` AS `rowindex`,
19-
`bfcol_7` AS `json_col`
20-
FROM `bfcte_2`
12+
`bfcol_1` AS `json_col`
13+
FROM `bfcte_1`
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
WITH `bfcte_0` AS (
22
SELECT
3-
`rowindex` AS `bfcol_0`,
4-
`string_list_col` AS `bfcol_1`
3+
`string_list_col` AS `bfcol_0`
54
FROM `bigframes-dev`.`sqlglot_test`.`repeated_types`
65
), `bfcte_1` AS (
76
SELECT
87
*,
9-
`bfcol_1`[SAFE_OFFSET(1)] AS `bfcol_4`
8+
`bfcol_0`[SAFE_OFFSET(1)] AS `bfcol_1`
109
FROM `bfcte_0`
1110
)
1211
SELECT
13-
`bfcol_0` AS `rowindex`,
14-
`bfcol_4` AS `string_list_col`
12+
`bfcol_1` AS `string_list_col`
1513
FROM `bfcte_1`
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
WITH `bfcte_0` AS (
22
SELECT
3-
`rowindex` AS `bfcol_0`,
4-
`string_list_col` AS `bfcol_1`
3+
`string_list_col` AS `bfcol_0`
54
FROM `bigframes-dev`.`sqlglot_test`.`repeated_types`
65
), `bfcte_1` AS (
76
SELECT
87
*,
98
ARRAY(
109
SELECT
1110
el
12-
FROM UNNEST(`bfcol_1`) AS el WITH OFFSET AS slice_idx
11+
FROM UNNEST(`bfcol_0`) AS el WITH OFFSET AS slice_idx
1312
WHERE
1413
slice_idx >= 1
15-
) AS `bfcol_4`
14+
) AS `bfcol_1`
1615
FROM `bfcte_0`
1716
)
1817
SELECT
19-
`bfcol_0` AS `rowindex`,
20-
`bfcol_4` AS `string_list_col`
18+
`bfcol_1` AS `string_list_col`
2119
FROM `bfcte_1`
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
WITH `bfcte_0` AS (
22
SELECT
3-
`rowindex` AS `bfcol_0`,
4-
`string_list_col` AS `bfcol_1`
3+
`string_list_col` AS `bfcol_0`
54
FROM `bigframes-dev`.`sqlglot_test`.`repeated_types`
65
), `bfcte_1` AS (
76
SELECT
87
*,
98
ARRAY(
109
SELECT
1110
el
12-
FROM UNNEST(`bfcol_1`) AS el WITH OFFSET AS slice_idx
11+
FROM UNNEST(`bfcol_0`) AS el WITH OFFSET AS slice_idx
1312
WHERE
1413
slice_idx >= 1 AND slice_idx < 5
15-
) AS `bfcol_4`
14+
) AS `bfcol_1`
1615
FROM `bfcte_0`
1716
)
1817
SELECT
19-
`bfcol_0` AS `rowindex`,
20-
`bfcol_4` AS `string_list_col`
18+
`bfcol_1` AS `string_list_col`
2119
FROM `bfcte_1`

0 commit comments

Comments
 (0)