Skip to content

dbt_run_results always fails on a new database #1988

@boblannon

Description

@boblannon

Describe the bug
elementary.dbt_run_results model fails when running for the first time against a new database. Minor annoyance.

To Reproduce
Steps to reproduce the behavior:

  1. Start with new dbt project, with no elementary tables created
  2. run dbt run
  3. See error:
    [CAST_OVERFLOW_IN_TABLE_INSERT] Fail to assign a value of "BIGINT" type to the "INT" type column or variable `rows_affected` due to an overflow. Use `try_cast` on the input value to tolerate overflow and return NULL instead. SQLSTATE: 22003
    
  4. Re-run, everything is fine

Expected behavior
dbt run completes with no errors on the initial run

Screenshots
n/a

Environment (please complete the following information):

  • Elementary CLI (edr) version: NA
  • Elementary dbt package version: 0.19.1
  • dbt version you're using: 1.10.9
  • Data warehouse: databricks
  • Infrastructure details: Happens when running as a DBT Task using Databricks Jobs, but also when running from a local debian container

Additional context
Again, re-running the project seems to succeed fine, there's just an issue with the first run.

Would you be willing to contribute a fix for this issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions