Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 of 5 tasks
daviibf opened this issue Jan 23, 2025 · 1 comment
Labels
bug Something isn't working triage

Comments

@daviibf
Copy link

daviibf commented Jan 23, 2025

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

@daviibf daviibf added bug Something isn't working triage labels Jan 23, 2025
@daviibf daviibf changed the title generate_model_yaml function is writing columns description only for table materializations The generate_model_yaml function is only writing column descriptions for tables with table materializations. Jan 23, 2025
@daviibf daviibf changed the title The generate_model_yaml function is only writing column descriptions for tables with table materializations. The generate_model_yaml function is only writing column descriptions for tables with table materializations Jan 23, 2025
@henry-yu-gce
Copy link

Wanted to chime in and say that I'm also experiencing this issue using BigQuery and materialized as anything but table (in this schema or any dependent schema)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

2 participants