Skip to content

Improve usability of regexp and other functions #1446

@timsaucer

Description

@timsaucer

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

In functions like regexp_count we have definition like this:

def regexp_count(
    string: Expr, pattern: Expr, start: Expr | None = None, flags: Expr | None = None
) -> Expr:

It is a common pattern that the pattern is a string, the start is an integer, and flags is a string (or single character).

It would be more pythonic if we can just pass those values without wrapping them in a lit() call.

Describe the solution you'd like

Review the regexp functions in the function library and find other common patterns.

For each allow users to not have to specify a Expr. We do this in other places in the code, so a pattern is already established.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions