You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make modules.re methods accept an already compiled pattern (#5430)
* 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
0 commit comments