Skip to content

[BUG] Jinja: re.search not truthy when regex search found #581

@boxysean

Description

@boxysean

Describe the bug
Similar to #560, a successful re.search does not return truthy value when successful.

What version of dbt Fusion is this bug in? (find out by running dbt --version)
dbt-fusion 2.0.0-preview.2

Is this a discrepancy between the dbt Fusion Engine and dbt Core? Check one.

  • YES
  • NO

To Reproduce

  1. Open this workspace
  2. Follow the instructions in the README

Or these original instructions:

{%- set re = modules.re -%}
{%- set re_dur = re.compile('.*') -%}
{%- set dur = re.search(re_dur, 'xyz') -%}

{% if dur %}
select {{ dur }} as should_be_true
{% endif %}

-- Core compiles to: "select <re.Match object; span=(0, 3), match='xyz'> as should_be_true"
-- Fusion compiles to: <empty>

Expected behavior
Fusion's modules.re.search returns truthy like Core does

Screenshots
N/A

Operating System and CPU Type (please complete the following information):
Mac Apple Silicon

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdiscrepancydiscrepancy between the dbt Fusion Engine and dbt Corehas-reproHas a reproducible example

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions