I upgraded elementary version of both python packa...
# community-support
y
I upgraded elementary version of both python package (for edr) and dbt package from 0.16.1 to 0.17.0. It raises below error. The explanation of the problem is that on dbt_snapshots table the newer version edr report looks for UNIQUE_KEY and it is missing (Snowflake). I tried going from 0.16.1 to 0.16.2, and I encountered with the same problem. I also run dbt run -s elementary before running my models and starting edr report . BUG
Copy code
[2025-03-13 17:29:43+0300] INFO - prefect.edr report | {"info": {"name": "RunningOperationCaughtError", "code": "Q001", "msg": "Encountered an error while running operation: Database Error\n 000904 (42000): SQL compilation error: error line 21 at position 18\n invalid identifier 'UNIQUE_KEY'", "level": "error", "invocationId": "c232cbdd-f7a5-4b7e-855c-be8cdd3bf63a", "pid": 94804, "thread": "MainThread", "ts": "2025-03-13T14:29:42.177560Z"}, "data": {"exc": "Database Error\n 000904 (42000): SQL compilation error: error line 21 at position 18\n invalid identifier 'UNIQUE_KEY'"}}
The Error Raising Query on Snowflake
Copy code
with dbt_artifacts_snapshots as (
        select 
         name,
         case when alias is not null then alias
         else name end as table_name,
         unique_id,
         owner as owners,
         tags,
         package_name,
         description,
         meta,
         materialization,
         database_name,
         schema_name,
         depends_on_macros,
         depends_on_nodes,
         original_path as full_path,
         path,
         patch_path,
         generated_at,
         unique_key,
         incremental_strategy
        from MY_DB.MY_SCHEMA_ELEMENTARY.dbt_snapshots
       )
      select * from dbt_artifacts_snapshots
n
Hey, there are some compatibility issues in those versions, we just adjusted these minor versions so there's no confusion. Update to the dbt package to 0.17.0 and run
dbt run --select elementary
again 😊
y
I didn't understand your answer Noya. When I migrated from 0.16.1 to 0.17.0, I keep getting the above error even if I run
dbt run --select elementary
Version upgrades are so much important for us. Since elementary is at a non-stable 0.x.x version, facing with failures while trying to upgrade is highly disencouraging 😕
n
I understand the inconvenience! There was one version misalignment between the dbt package and the CLI package, that’s why we changed both minor versions to 17. Practically, CLI 0.16.2 and above will work with dbt package 0.16.3 and above.
y
Okey, as far as I understand you suggest that if I use minor version 17 for both cli and dbt package, it should work. Right?
But the problem is that for both cli and dbt packages, I upgraded their version to minor 17 and got the above error.
n
Hey @Yunus Emre Gündüz, can you please check your DWH to see if the
dbt_snapshots
table has a column
unique_key
? This column was added on dbt package 0.16.2.
y
Nope, the column does not exist in the table. I first run elementary using version 0.16.1.
👀 1