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

[Feature] Raise a clearer error message for resource types that don't support enforcing contracts #9607

Open
2 tasks done
dbeatty10 opened this issue Feb 20, 2024 · 0 comments
Labels
enhancement New feature or request model_contracts snapshots Issues related to dbt's snapshot functionality

Comments

@dbeatty10
Copy link
Contributor

dbeatty10 commented Feb 20, 2024

Is this a new bug in dbt-core?

  • I believe this is a new bug in dbt-core
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

#9542 describes the current behavior, namely:

dbt should raise a descriptive error message if a user adds a model contract to any of the following:

  • Python models.
  • ephemeral-materialized SQL models.
  • Other resource types, such as sources, seeds, snapshots, and so on.

Put another way, dbt should raise an error for model contracts that don't have all of the following properties:

  • resource_type == "model"
  • language == "sql"
  • materialized in ("incremental", "table", "view", "materialized_view")

Expected Behavior

#9542 (comment) describes the desired behavior.

Steps To Reproduce

See "current behavior" above.

Relevant log output

No response

Environment

- OS:
- Python:
- dbt:

Which database adapter are you using with dbt?

No response

Additional Context

No response

@dbeatty10 dbeatty10 added bug Something isn't working triage and removed triage labels Feb 20, 2024
@jtcohen6 jtcohen6 added enhancement New feature or request and removed bug Something isn't working labels Feb 20, 2024
@jtcohen6 jtcohen6 changed the title [Bug] Snapshots don't support model contracts, but don't raise an error [Enhancement] Raise a clearer error message for resource types that don't support enforcing contracts Feb 20, 2024
@dbeatty10 dbeatty10 added snapshots Issues related to dbt's snapshot functionality model_contracts labels Jul 3, 2024
@dbeatty10 dbeatty10 changed the title [Enhancement] Raise a clearer error message for resource types that don't support enforcing contracts [Feature] Raise a clearer error message for resource types that don't support enforcing contracts Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request model_contracts snapshots Issues related to dbt's snapshot functionality
Projects
None yet
Development

No branches or pull requests

2 participants