-
Notifications
You must be signed in to change notification settings - Fork 67
Make modules.re
methods accept an already compiled pattern
#601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3179aca
to
a1b0e92
Compare
2 tasks
gshank
approved these changes
Sep 2, 2025
felipecrv
approved these changes
Sep 2, 2025
pull request has been merged. |
fa-assistant
added a commit
that referenced
this pull request
Sep 5, 2025
* Make `modules.re` methods accept an already compiled pattern COPYBARA PUBLIC PR: #601 Fixes part of #581 ("Compilation failures: The user's example still produces empty files in Fusion"). Methods in `modules.re` (such as `search` and `match`) can take both a string for the initial pattern argument as well an already compiled expression. Before this change only the string variant was correctly supported: ```jinja2 {%- set pattern = '.*' -%} {%- set result = re.search(pattern, 'xyz') -%} ``` This change makes compiled patterns work as well, restoring compatibility with [pythons re](https://docs.python.org/3/library/re.html) / dbt-core / jinja2: ```jinja2 {%- set pattern = re.compile('.*') -%} {%- set result = re.search(pattern, 'xyz') -%} ``` The rust edition in the `minijinja-contrib` crate was bumped to `2024` to allow the [let chain](rust-lang/rust#132833) used here. Bumping the edition means that `cargo fmt` formats differently - the (otherwise unrelated) formatting changes are done in the second commit in this PR, while the first commit contains the actual change. GitOrigin-RevId: 99d438c * Make `modules.re` methods accept an already compiled pattern COPYBARA PUBLIC PR: #601 Fixes part of #581 ("Compilation failures: The user's example still produces empty files in Fusion"). Methods in `modules.re` (such as `search` and `match`) can take both a string for the initial pattern argument as well an already compiled expression. Before this change only the string variant was correctly supported: ```jinja2 {%- set pattern = '.*' -%} {%- set result = re.search(pattern, 'xyz') -%} ``` This change makes compiled patterns work as well, restoring compatibility with [pythons re](https://docs.python.org/3/library/re.html) / dbt-core / jinja2: ```jinja2 {%- set pattern = re.compile('.*') -%} {%- set result = re.search(pattern, 'xyz') -%} ``` The rust edition in the `minijinja-contrib` crate was bumped to `2024` to allow the [let chain](rust-lang/rust#132833) used here. Bumping the edition means that `cargo fmt` formats differently - the (otherwise unrelated) formatting changes are done in the second commit in this PR, while the first commit contains the actual change. GitOrigin-RevId: 9dd9420 * Cargo fmt * remove old changelog * Change code to avoid clippy complaint about unstable let * rename conflicting test name * update test output * Improve sdf-make-sql-functions build command Let cargo consider only the actually necessary dependencies. When `-p` is not present, cargo will do dependency feature unification across all crates first. * Remove table qualifiers in UNION plan After UNION (or other set operation), the names are no longer qualified. Keeping them qualified is incorrect (allows referencing which would be rejected by CDW) and causes planning failures in DataFusion 48. * Make `modules.re` methods accept an already compiled pattern COPYBARA PUBLIC PR: #601 Fixes part of #581 ("Compilation failures: The user's example still produces empty files in Fusion"). Methods in `modules.re` (such as `search` and `match`) can take both a string for the initial pattern argument as well an already compiled expression. Before this change only the string variant was correctly supported: ```jinja2 {%- set pattern = '.*' -%} {%- set result = re.search(pattern, 'xyz') -%} ``` This change makes compiled patterns work as well, restoring compatibility with [pythons re](https://docs.python.org/3/library/re.html) / dbt-core / jinja2: ```jinja2 {%- set pattern = re.compile('.*') -%} {%- set result = re.search(pattern, 'xyz') -%} ``` The rust edition in the `minijinja-contrib` crate was bumped to `2024` to allow the [let chain](rust-lang/rust#132833) used here. Bumping the edition means that `cargo fmt` formats differently - the (otherwise unrelated) formatting changes are done in the second commit in this PR, while the first commit contains the actual change. GitOrigin-RevId: 99d438c * Cargo fmt * fix bad merge * Update output for flaky test test_regression_tests_internal_analytics_build_selector_cloud_users_1 * Remove old changelog --------- Co-authored-by: Fredrik Fornwall <[email protected]> Co-authored-by: Gerda Shank <[email protected]> Co-authored-by: Gerda Shank <[email protected]> Co-authored-by: Piotr Findeisen <[email protected]> GitOrigin-RevId: dafcf71594623b1ce94e126eb1dd6f9a6896656a
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes part of #581 ("Compilation failures: The user's example still produces empty files in Fusion").
Methods in
modules.re
(such assearch
andmatch
) can take both a string for the initial pattern argument as well an already compiled expression.Before this change only the string variant was correctly supported:
This change makes compiled patterns work as well, restoring compatibility with pythons re / dbt-core / jinja2:
The rust edition in the
minijinja-contrib
crate was bumped to2024
to allow the let chain used here. Bumping the edition means thatcargo fmt
formats differently - the (otherwise unrelated) formatting changes are done in the second commit in this PR, while the first commit contains the actual change.