-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Running a snapshot with missing required configurations results in uncaught Python exception #3381
Comments
@jnatkins Such a good issue, and a great catch, thank you for opening! I think there's a pretty straightforward resolution here, which is adding a check to the This method already exists to ensure that snapshots with certain strategies ( if not data.get('strategy') or not data.get('unique_key') or not data.get('target_schema'):
raise ValidationError(
"Snapshots must be configured with a 'strategy', 'unique_key', and 'target_schema'.") So instead of
Whether those configs are set via in-file I'm going to tag this as a |
@jtcohen6 I'd definitely be interested in contributing a fix here. I don't have a dev environment set up for dbt core yet, but I can probably scrape something together pretty quickly. |
…caught Python exception (dbt-labs#3381) * Running a snapshot with missing required configurations results in uncaught Python exception
…... (#3385) * Running a snapshot with missing required configurations results in uncaught Python exception (#3381) * Running a snapshot with missing required configurations results in uncaught Python exception * Add fix details to CHANGELOG * Update CHANGELOG.md * Update invalid snapshot test with new/improved error message * Improve changelog message and contributors addition
…... (#3385) * Running a snapshot with missing required configurations results in uncaught Python exception (#3381) * Running a snapshot with missing required configurations results in uncaught Python exception * Add fix details to CHANGELOG * Update CHANGELOG.md * Update invalid snapshot test with new/improved error message * Improve changelog message and contributors addition automatic commit by git-black, original commits: c0c487b
Describe the bug
In an attempt to educate myself on how snapshots work, I created a snapshot to test out, but neglected to realize that the configuration object was required. When I ran
dbt snapshot
, it failed with a fairly non-actionable error message:Steps To Reproduce
dbt snapshot
Expected behavior
It would be helpful to get an error message that indicates what actually went wrong, and guides the user to provide required configurations
Screenshots and log output
If applicable, add screenshots or log output to help explain your problem.
System information
Which database are you using dbt with?
The output of
dbt --version
:The operating system you're using:
MacOS
The output of
python --version
:Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: