Skip to content

str.format() doesn't work in dbt Fusion #390

Description

@joshuanits

To be clear, not an issue with dbt-autofix, not sure if this is a known deprecation vs bug in dbt Fusion

{{ str.format(i) }} doesn't work in dbt Fusion, alternatives like {{ "%s" % i }} do work.

Examples with dbt-core 1.11.11 and dbt-fusion 2.0.0-preview.189

Using str.format:

select
{% for i in [0, 1, 2, 10, 11, 12] -%}
    {{ '{:02}'.format(i) }}, 
{%- endfor %}
-- dbt-core
select
00,01,02,10,11,12,
-- dbt Fusion
select
{:02},{:02},{:02},{:02},{:02},{:02},

Using % printf style formatting:

select
{% for i in [0, 1, 2, 10, 11, 12] -%}
    {{ "%02d" % i }},
{%- endfor %}
-- dbt-core
select
00,01,02,10,11,12,
-- dbt Fusion
select
00,01,02,10,11,12,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions