|
29 | 29 | Expr, |
30 | 30 | SortExpr, |
31 | 31 | SortKey, |
| 32 | + _to_raw_literal_expr, |
32 | 33 | expr_list_to_raw_expr_list, |
33 | 34 | sort_list_to_raw_sort_list, |
34 | 35 | sort_or_default, |
35 | | - _to_raw_literal_expr, |
36 | 36 | ) |
37 | 37 |
|
38 | 38 | __all__ = [ |
@@ -1471,9 +1471,6 @@ def regexp_like( |
1471 | 1471 | >>> result.collect_column("m")[0].as_py() |
1472 | 1472 | True |
1473 | 1473 | """ |
1474 | | - # if flags is not None: |
1475 | | - # flags = flags.expr |
1476 | | - # return Expr(f.regexp_like(string.expr, regex.expr, flags)) |
1477 | 1474 | flags = _to_raw_literal_expr(flags) if flags is not None else None |
1478 | 1475 | return Expr(f.regexp_like(string.expr, _to_raw_literal_expr(regex), flags)) |
1479 | 1476 |
|
@@ -1508,9 +1505,6 @@ def regexp_match( |
1508 | 1505 | >>> result.collect_column("m")[0].as_py() |
1509 | 1506 | ['hello'] |
1510 | 1507 | """ |
1511 | | - # if flags is not None: |
1512 | | - # flags = flags.expr |
1513 | | - # return Expr(f.regexp_match(string.expr, regex.expr, flags)) |
1514 | 1508 | flags = _to_raw_literal_expr(flags) if flags is not None else None |
1515 | 1509 | return Expr(f.regexp_match(string.expr, _to_raw_literal_expr(regex), flags)) |
1516 | 1510 |
|
@@ -1553,9 +1547,6 @@ def regexp_replace( |
1553 | 1547 | >>> result.collect_column("r")[0].as_py() |
1554 | 1548 | 'aX bX cX' |
1555 | 1549 | """ |
1556 | | - # if flags is not None: |
1557 | | - # flags = flags.expr |
1558 | | - # return Expr(f.regexp_replace(string.expr, pattern.expr, replacement.expr, flags)) |
1559 | 1550 | flags = _to_raw_literal_expr(flags) if flags is not None else None |
1560 | 1551 | pattern = _to_raw_literal_expr(pattern) |
1561 | 1552 | replacement = _to_raw_literal_expr(replacement) |
@@ -1594,10 +1585,6 @@ def regexp_count( |
1594 | 1585 | >>> result.collect_column("c")[0].as_py() |
1595 | 1586 | 1 |
1596 | 1587 | """ |
1597 | | - # if flags is not None: |
1598 | | - # flags = flags.expr |
1599 | | - # start = start.expr if start is not None else start |
1600 | | - # return Expr(f.regexp_count(string.expr, pattern.expr, start, flags)) |
1601 | 1588 | flags = _to_raw_literal_expr(flags) if flags is not None else None |
1602 | 1589 | start = _to_raw_literal_expr(start) if start is not None else None |
1603 | 1590 | return Expr( |
@@ -1659,10 +1646,6 @@ def regexp_instr( |
1659 | 1646 | >>> result.collect_column("pos")[0].as_py() |
1660 | 1647 | 1 |
1661 | 1648 | """ |
1662 | | - # start = start.expr if start is not None else None |
1663 | | - # n = n.expr if n is not None else None |
1664 | | - # flags = flags.expr if flags is not None else None |
1665 | | - # sub_expr = sub_expr.expr if sub_expr is not None else None |
1666 | 1649 | regex = _to_raw_literal_expr(regex) |
1667 | 1650 | start = _to_raw_literal_expr(start) if start is not None else None |
1668 | 1651 | n = _to_raw_literal_expr(n) if n is not None else None |
|
0 commit comments