Skip to content

feat; add deprecation_date key to dbt_models metadata model#987

Open
scrambldchannel wants to merge 4 commits intoelementary-data:masterfrom
scrambldchannel:dev/deprecation_dates
Open

feat; add deprecation_date key to dbt_models metadata model#987
scrambldchannel wants to merge 4 commits intoelementary-data:masterfrom
scrambldchannel:dev/deprecation_dates

Conversation

@scrambldchannel
Copy link
Copy Markdown

@scrambldchannel scrambldchannel commented Apr 15, 2026

What

This is a quick attempt to address #986 by adding the column to the upload_dbt_models macro that populates the dbt_models model.

I've also added the new column, and several other missing columns, the properties for the model.

Why

We, and presumably others, leverage this column as a way to flag upcoming model deprecation to developers and also to automatically remove models from our project. If we could have this column in dbt_models, it would make analysis, and automated notifications to users easier. As far as I'm aware, there isn't a way to currently do this and I don't see a record of this being discussed previously.

TODO / Questions

I still need to do some testing but thought I might as well create a draft PR to accompany the issue I raised in case this is a non starter.

I've tested this locally and the resulting deprecation_date column picks up the value as expected. I've also run the integration tests against a postgres target successfully and will attach a log file.

I will do some functional testing against Snowflake using a branch in my repo too.

I also need to think about the appropriate data type to use for this column

I think leaving this as is the right approach but happy to be contradicted

Summary by CodeRabbit

  • New Features
    • Extended the dbt_models artifact table with seven new metadata fields: deprecation_date, patch_path, metadata_hash, unique_key, incremental_strategy, group_name, and access. These additions enhance model metadata tracking and capture additional configuration properties from dbt graph sources.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3c653696-b388-4dd4-ac42-e466c200caee

📥 Commits

Reviewing files that changed from the base of the PR and between 9f32d47 and 72a3b31.

📒 Files selected for processing (2)
  • macros/edr/dbt_artifacts/upload_dbt_models.sql
  • models/dbt_artifacts.yml

📝 Walkthrough

Walkthrough

The dbt_models artifact is extended with seven new columns (patch_path, metadata_hash, unique_key, incremental_strategy, group_name, access, and deprecation_date). The SQL macro is updated to extract and include deprecation_date from model metadata, while the schema definition documents all new fields.

Changes

Cohort / File(s) Summary
dbt_models artifact extension
macros/edr/dbt_artifacts/upload_dbt_models.sql, models/dbt_artifacts.yml
Added seven new columns to the dbt_models artifact schema (patch_path, metadata_hash, unique_key, incremental_strategy, group_name, access, deprecation_date). Updated flatten_model macro to extract deprecation_date from model metadata and include it in the flattened output.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 Our dbt models grow more wise,
With metadata in new disguise,
Deprecation dates now stored with care,
More details blooming everywhere!
The artifacts dance with fresh new light,
Our models' stories, ever bright.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: adding a deprecation_date column to the dbt_models metadata. However, it contains a semicolon instead of a colon after 'feat', which is a stylistic issue that deviates from conventional commit format.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

👋 @scrambldchannel
Thank you for raising your pull request.
Please make sure to add tests and document all user-facing changes.
You can do this by editing the docs files in the elementary repository.

@scrambldchannel
Copy link
Copy Markdown
Author

postgres_test_log.txt

@scrambldchannel scrambldchannel marked this pull request as ready for review April 15, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant