File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed
bigframes/core/compile/sqlglot/expressions
tests/unit/core/compile/sqlglot/expressions/snapshots/test_string_ops Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -153,12 +153,15 @@ def _(expr: TypedExpr) -> sge.Expression:
153153
154154@register_unary_op (ops .isdecimal_op )
155155def _ (expr : TypedExpr ) -> sge .Expression :
156- return sge .RegexpLike (this = expr .expr , expression = sge .convert (r"^\d +$" ))
156+ return sge .RegexpLike (this = expr .expr , expression = sge .convert (r"^(\p{Nd}) +$" ))
157157
158158
159159@register_unary_op (ops .isdigit_op )
160160def _ (expr : TypedExpr ) -> sge .Expression :
161- return sge .RegexpLike (this = expr .expr , expression = sge .convert (r"^\p{Nd}+$" ))
161+ regexp_pattern = (
162+ r"^[\p{Nd}\x{00B9}\x{00B2}\x{00B3}\x{2070}\x{2074}-\x{2079}\x{2080}-\x{2089}]+$"
163+ )
164+ return sge .RegexpLike (this = expr .expr , expression = sge .convert (regexp_pattern ))
162165
163166
164167@register_unary_op (ops .islower_op )
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ WITH `bfcte_0` AS (
55), ` bfcte_1` AS (
66 SELECT
77 * ,
8- REGEXP_CONTAINS(` string_col` , ' ^\\ d +$' ) AS ` bfcol_1`
8+ REGEXP_CONTAINS(` string_col` , ' ^( \\ p{Nd}) +$' ) AS ` bfcol_1`
99 FROM ` bfcte_0`
1010)
1111SELECT
Original file line number Diff line number Diff line change @@ -5,7 +5,10 @@ WITH `bfcte_0` AS (
55), ` bfcte_1` AS (
66 SELECT
77 * ,
8- REGEXP_CONTAINS(` string_col` , ' ^\\ p{Nd}+$' ) AS ` bfcol_1`
8+ REGEXP_CONTAINS(
9+ ` string_col` ,
10+ ' ^[\\ p{Nd}\\ x{00B9}\\ x{00B2}\\ x{00B3}\\ x{2070}\\ x{2074}-\\ x{2079}\\ x{2080}-\\ x{2089}]+$'
11+ ) AS ` bfcol_1`
912 FROM ` bfcte_0`
1013)
1114SELECT
You can’t perform that action at this time.
0 commit comments