-
Notifications
You must be signed in to change notification settings - Fork 75
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
Support not-null constraints as part of primary key definition #373
Comments
Hey @katieclaiborne! This is a really great idea! I think we've intentionally stayed away from too much column-level madness, but I think this could be a good excuse to investigate how to bring those concepts into the package! To start, we could pull in all column info as a JSON string from the graph object in I can see a couple places where it could get tough!
I'm happy to do a little early research and report back! |
That'd be great! Thanks, Dave. |
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days. |
Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers. |
@katieclaiborne i am definitely willing to keep this open if you want! i think with the new column-level model, we might have some ability to add this in. Any interest in a contribution? |
Yes! Thank you, Dave. |
@dave-connors-3, hello from the other side! Could you offer a bit of guidance on how you would approach this? I have some time on my hands, and would be game to give it a try. |
Describe the feature
I'd like for a model with a unique test and a not-null constraint applied to the same column to satisfy the primary key rule.
Describe alternatives you've considered
In our project, we've considered overriding the
primary_key_test_macros
variables to define a uniqueness test alone as valid. This would allow developers to replace not-null tests with constraints, but it wouldn't validate that they have.Additional context
We use BigQuery, so the not-null constraint is the only one available to us.
Who will this benefit?
Teams looking to leverage constraints without duplicating existing tests or sacrificing test coverage.
Are you interested in contributing this feature?
I'd love to contribute, but would need a hand getting started.
I've poked around a bit to understand how the
primary_key_test_macros
variable is currently used, and I've inspected how constraints appear in the project manifest. The tricky bit seems to be that column-level constraints appear as part of the relevant model node, while tests appear as their own nodes, with dependencies on (test) macro and model nodes.The text was updated successfully, but these errors were encountered: