Codegn library - weird output

Weird output when using Codegen

I am testing out Codegen (dbt - Package hub) to create the base source.yml and basic sql models.

Macro for base model

{% macro generate_base_model() %}

{{ codegen.generate_base_model(
    source_name='tasty_bytes_sample_data',
    table_name='dbt_control_table'
) }}

{% endmacro%}

Then I run the following command:

(I use this command to save the output into a .sql file and I convert it to UTF-8, because this command is creating UTF-16 files, which dbt-core doesn’t like and raises errors).

dbt --quiet run-operation generate_base_model | Out-File -FilePath ./models/stg/test.sql -Encoding UTF8

So this command works when I am creating the schema.yml file using the macro generate_source_yml(). But when I use it on this macro to generate the base model, it gets an error.

10:30:24  Completed with 1 error and 0 warnings:
10:30:24
10:30:24    Database Error in model test (models\stg\test.sql)
  001003 (42000): SQL compilation error:
  syntax error line 4 at position 4 unexpected '
  '.
  syntax error line 10 at position 1 unexpected ','.
  compiled Code at target\run\dbt_test\models\stg\test.sql
10:30:24
10:30:24  Done. PASS=0 WARN=0 ERROR=1 SKIP=0 TOTAL=1

And when I go to the code executed on target/run:

Any idea of why this is happening? Or any other suggestion to manage this library? I want in the end to always have the output saved in a UTF-8 file.

Thanks in advance