Skip to content

The generate_model_yaml function is only writing column descriptions for tables with table materializationsΒ #247

@daviibf

Description

@daviibf

Describe the bug

For non-table materialized models, the generate_model_yaml method does not generate columns description.

Steps to reproduce

  1. Write an intermediary model of type materialized_view:
-- models/int_orders.sql

{{ config(
    materialized='view'  -- Specifies that this model should be materialized as a view
) }}

WITH orders AS (
    SELECT
        customer_id,
        order_id,
        order_date,
        order_status,
        total_amount
    FROM {{ ref('raw_orders') }}  -- Reference a raw source table
)

SELECT *
FROM orders
  1. Then, execute generate_model_yaml for this model.
version: 2

models:
  - name: int_orders
    description: ""
    columns:
      - name: customer_id
        data_type: uuid
        description: ""

      - name: order_id
        data_type: uuid
        description: ""

      - name: order_date
        data_type: timestamp
        description: ""

      - name: order_status
        data_type: character varying
        description: ""

      - name: total_amount
        data_type: numeric
        description: ""

Actual results

version: 2

models:
  - name: int_orders
    description: ""
    columns:

System information

The contents of your packages.yml file:

packages:
  - package: calogica/dbt_expectations
    version: [">=0.1.0", "<1.0.0"]
  - package: dbt-labs/audit_helper
    version: [">=0.3.0", "<1.0.0"]
  # - package: jpmmcneill/dbt_graph_theory
  #   version: [">=0.2.0", "<1.0.0"]
  - package: calogica/dbt_date
    version: [">=0.1.0", "<1.0.0"]
  - package: dbt-labs/logging
    version: [">=0.1.0", "<1.0.0"]
  - package: dbt-labs/dbt_utils
    version: [">=1.1.0", "<2.0.0"]
  - package: elementary-data/elementary
    version: 0.16.1
  - package: dbt-labs/codegen
    version: 0.13.1

Which database are you using dbt with?

  • postgres
  • redshift
  • bigquery
  • snowflake
  • other (specify: ____________)

The output of dbt --version:

Core:
  - installed: 1.9.1
  - latest:    1.9.1 - Up to date!

Plugins:
  - postgres: 1.9.0 - Up to date!

The operating system you're using:
Apple M3 Pro

The output of python --version:
Python 3.11.9

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions