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

[Core] Infer a model's primary_key based on configured data tests and/or constraints #5497

Closed
FishtownBuildBot opened this issue May 10, 2024 · 7 comments · Fixed by #6217
Closed
Assignees
Labels
content Improvements or additions to content dbt Core The changes proposed in this issue relate to dbt Core dbt-core v1.9 improvement Use this when an area of the docs needs improvement as it's currently unclear size: medium This change will take up to a week to address

Comments

@FishtownBuildBot
Copy link

FishtownBuildBot commented May 10, 2024

At a minimum, update body to include a link to the page on docs.getdbt.com requiring updates and what part(s) of the page you would like to see updated.

Originating from this issue: dbt-labs/dbt-core#9824
Pull request: dbt-labs/dbt-core#10096

See these for some background:

https://github.com/dbt-labs/dbt-core/blob/7940ad5c7858ff11ef100260a372f2f06a86e71f/core/dbt/contracts/graph/nodes.py#L534-L541

        Infers the columns that can be used as primary key of a model in the following order:
        1. Columns with primary key constraints
        2. Columns with unique and not_null data tests
        3. Columns with enabled unique or dbt_utils.unique_combination_of_columns data tests
        4. Columns with disabled unique or dbt_utils.unique_combination_of_columns data tests

The inferred primary_key is visible in dbt Explorer.

@runleonarun runleonarun added content Improvements or additions to content improvement Use this when an area of the docs needs improvement as it's currently unclear dbt Core The changes proposed in this issue relate to dbt Core labels May 10, 2024
@nataliefiann nataliefiann added the size: medium This change will take up to a week to address label Sep 10, 2024
@nghi-ly
Copy link
Contributor

nghi-ly commented Sep 13, 2024

@nataliefiann : this might not need docs changes. please double-check with dave before closing. thanks!

@nghi-ly nghi-ly changed the title Docs Changes Needed from dbt-core Issue #9824 [Core] Docs Changes Needed from dbt-core Issue #9824 Sep 13, 2024
@nataliefiann
Copy link
Contributor

Hiya @dave-connors-3

Happy Monday - I hope you're well.

I just wanted to ask if this still needs a docs update?

Kind Regards
Natalie

@dave-connors-3
Copy link
Contributor

@nataliefiann morning! i do think this should probably be documented, but I don't know where would be the most appropriate! do you have any suggestions?

@nataliefiann
Copy link
Contributor

Hiya @dave-connors-3

I'll query this for you and get back to you on as soon as I have an update.

Kind Regards

@nataliefiann
Copy link
Contributor

Hiya @dave-connors-3

Happy Almost Friday!

Would it be ok to doc it in the manifest.json page and then when the PR is created and merged, I can ref the section in the test page or constraints page?

Kind Regards
Natalie

@nataliefiann
Copy link
Contributor

Hiya @dave-connors-3

I hope you're well.

I was going over the Git issues today and realised I created a PR for this issue (from this issue a few days ago. It's just awaiting a few. I'll add you as a reviewer to the ticket and another PR I updated for it.

Kind Regards
Natalie

@dbeatty10 dbeatty10 changed the title [Core] Docs Changes Needed from dbt-core Issue #9824 [Core] Infer a model's primary_key based on configured data tests and/or constraints Oct 1, 2024
@runleonarun
Copy link
Collaborator

Conferred with Doug and Grace. Creating a release note for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Improvements or additions to content dbt Core The changes proposed in this issue relate to dbt Core dbt-core v1.9 improvement Use this when an area of the docs needs improvement as it's currently unclear size: medium This change will take up to a week to address
Projects
None yet
6 participants