Skip to content

relation.is_iceberg_format -> relation.is_iceberg_format() #380

Description

@dbeatty10

Core uses relation.is_iceberg_format (no parentheses at the end) whereas Fusion uses relation.is_iceberg_format() (with parentheses!)

So if a Core user has an override for the snowflake__alter_relation_comment macro like this:

{% macro snowflake__alter_relation_comment(relation, relation_comment) -%}
    {%- if relation.is_dynamic_table -%}
        {%- set relation_type = 'dynamic table' -%}
    {%- elif relation.is_iceberg_format -%}
        {%- set relation_type = 'iceberg table' -%}
    {%- else -%}
        {%- set relation_type = relation.type -%}
    {%- endif -%}

    {%- if relation.is_iceberg_format -%}
        alter iceberg table {{ relation.render() }} set comment = $${{ relation_comment | replace('$', '[$]') }}$$;
    {%- else -%}
        comment on {{ relation_type }} {{ relation.render() }} IS $${{ relation_comment | replace('$', '[$]') }}$$;
    {%- endif -%}
{% endmacro %}

Then they will need to replace relation.is_iceberg_format with relation.is_iceberg_format() for Fusion.

It would be great if Autofix can handle situations like this.

Additional info

Here's one way to search the Fusion source code for differences like this between Fusion and Core:
https://github.com/search?q=repo%3Adbt-labs%2Fdbt-fusion%20DIVERGENCE&type=code

It will find code comments with DIVERGENCE like this:

    {%- if relation.is_iceberg_format() -%} {# DIVERGENCE: in core is_iceberg_format is an attribute of the relation object, not a method #}

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