dbt_artifacts icon indicating copy to clipboard operation
dbt_artifacts copied to clipboard

[Bug]: `rows_affected` always `null`

Open LProcopi15 opened this issue 9 months ago • 1 comments

Overview

fct_dbt__model_executions.row_affected is null for all tables and incremental models on dbt Databricks.

How to reproduce

Add latest to packages.yml:

  - package: brooklyn-data/dbt_artifacts
    version: 2.8.0

Add on-run-end to dbt-project.yml:

on-run-end:
  - "{{ dbt_artifacts.upload_results(results) }}"

Run package tables dbt run --select dbt_artifacts

Create a new table model:

{{ config(
    materialized='table'
)}}

select 1 as foo

Query fct_dbt__model_executions

Expected behaviour

fct_dbt__model_executions for our foo model should have rows_affected = 1, but it has rows_affected = null

Screenshots

Environment

Results of running dbt --version:

dbt cloud: Registered adapter: databricks=1.9.4-post1+fd9c6587bb6122e5b3614569bca2d499f531ace7

Please paste the contents of your packages.yml file here:

packages:
  - package: brooklyn-data/dbt_artifacts
    version: 2.8.0

LProcopi15 avatar Mar 04 '25 17:03 LProcopi15

Got the same thing on Postgresql. Below is actual DBT log. 543 is actual inserted quantity.

18:47:36  [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.bi.intermediate.power_bi_rest_api
18:47:36  Found 108 models, 1 seed, 1 operation, 81 data tests, 1 snapshot, 8 sources, 1 exposure, 992 macros
18:47:37  
18:47:37  Concurrency: 8 threads (target='dev')
18:47:37  
18:47:37  1 of 1 START sql table model yb_analytics.fct_sophos__endpoints ................ [RUN]
18:47:38  1 of 1 OK created sql table model yb_analytics.fct_sophos__endpoints ........... [INSERT 0 543 in 0.49s]
18:47:38  
18:47:38  Uploading model executions
18:47:38  Uploading seed executions
18:47:38  Uploading test executions
18:47:38  Uploading snapshot executions
18:47:38  Uploading exposures
18:47:38  Uploading seeds
18:47:38  Uploading snapshots
18:47:38  Uploading invocations
18:47:38  Uploading sources
18:47:38  Uploading tests
18:47:38  Uploading models
18:47:38  1 of 1 START hook: bi.on-run-end.0 ............................................. [RUN]
18:47:38  1 of 1 OK hook: bi.on-run-end.0 ................................................ [OK in 0.65s]
18:47:38  
18:47:38  Finished running 1 project hook, 1 table model in 0 hours 0 minutes and 1.87 seconds (1.87s).
18:47:39  
18:47:39  Completed successfully
18:47:39  
18:47:39  Done. PASS=2 WARN=0 ERROR=0 SKIP=0 TOTAL=2

krutoileshii avatar May 11 '25 18:05 krutoileshii