Skip to content

Add fix as_bool on sequence warning to manual_fixes folder #261

@dbeatty10

Description

@dbeatty10

@dbeatty10 - this one is just a warning (and it's actually a good one) - as_bool() on an array here would yield the incorrect result. The jinja expansion (in both python and rust) puts filters at the highest precedence, meaning as_bool() in dbt-core was being applied to an array (but that was only wrapping the array struct with AsBool) and then this AsBool is dropped when the comparison check of target.type in ['redshift', 'postgres'] happens. In fusion, we are warning to let the user know that AsBool is doing nothing in this example - just a passthrough.

To fix, I believe it's sufficient to do:

+enabled: "{{ target.type in ['redshift', 'postgres'] }}"
-- or
+enabled: "{{ (target.type in ['redshift', 'postgres']) | as_bool() }}" -- if you want to be extra careful for some reason

Originally posted by @akbog in #1113

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions