Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DBT snapshot with user defined dbt_valid_from and dbt_valid_to and dbt_updated_at #9848

Closed
3 tasks done
ashwintastic opened this issue Apr 3, 2024 · 3 comments
Closed
3 tasks done
Labels
enhancement New feature or request snapshots Issues related to dbt's snapshot functionality

Comments

@ashwintastic
Copy link

Is this your first time submitting a feature request?

  • I have read the expectations for open source contributors
  • I have searched the existing issues, and I could not find an existing issue for this feature
  • I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion

Describe the feature

Currently dbt snapshot generates table where time dimension columns are dbt_valid_from and dbt_valid_to.
The ask is to give the flexibility to dbt snapshot wherein a user can pass their columns name like instead of dbt_valid_from could have start_date and dbt_valid_to => end_date.

Describe alternatives you've considered

No response

Who will this benefit?

No response

Are you interested in contributing this feature?

No response

Anything else?

No response

@ashwintastic ashwintastic added enhancement New feature or request triage labels Apr 3, 2024
@dbeatty10 dbeatty10 added the snapshots Issues related to dbt's snapshot functionality label Apr 3, 2024
@dbeatty10
Copy link
Contributor

Thanks for proposing this idea @ashwintastic ! 💡

We aren't planning on allowing custom configuration of the column names produced by snapshots. But you can still achieve your goal of changing into any column names you like by creating a pass-through view like this:

models/your_snapshot_passthru.sql

{{ config(materialized="view") }}

select
  -- the rest of your columns here
  dbt_valid_from as start_date,
  dbt_valid_to as end_date

from {{ ref("your_snapshot") }}

@dbeatty10 dbeatty10 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 3, 2024
@dbeatty10 dbeatty10 removed the triage label Apr 3, 2024
@ashwintastic
Copy link
Author

If user-defined column names are not allowed, database column names become dependent on DBT. Imagine in the future, there could be a scenario where we receive an update from DBT stating that from XYZ version onwards, DBT doesn't support certain column names (dbt_valid_from , dbt_valid_to . This could potentially have a significant impact on the product using DBT.

@graciegoheen
Copy link
Contributor

Hi @ashwintastic just as a heads up we opened up a new issue for this feature request #10185

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request snapshots Issues related to dbt's snapshot functionality
Projects
None yet
Development

No branches or pull requests

3 participants