Skip to content

[Bug]: Dim Models grows indefinitely, dbt models reinserted on every execution #525

@miguermv

Description

@miguermv

Overview

We're seeing an issue with the dbt_artifacts package, specifically with the dim_models table. Every time we run a dbt command, all models in the project are being reinserted into this table instead of being updated or deduplicated. As a result, it grows extremely fast. After just a few days, we end up with around 16 million rows, even though we only have about 1,500 models in our dbt project.

How to reproduce

  1. Use dbt_artifacts in a dbt Core project (we're using Snowflake).
  2. Run any dbt command (dbt run, dbt build, etc.).
  3. Check the dim_models table.
  4. Notice that instead of updating existing rows, all models are added again.

Expected behaviour

dim_models should have one row per model, updated when necessary, not duplicated on every run. The row count shouldn't grow if the models haven't changed.

Environment

dbt --version:

Core:
  - installed: 1.10.10

packages.yml:

packages:
  - package: metaplane/dbt_expectations
    version: 0.10.9

  - package: dbt-labs/dbt_utils
    version: 1.1.1

  - package: dbt-labs/codegen
    version: 0.12.1

  - package: elementary-data/elementary
    version: 0.15.2

  - package: get-select/dbt_snowflake_query_tags
    version: [">=2.0.0", "<3.0.0"]

  - package: brooklyn-data/dbt_artifacts
    version: 2.9.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions