-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Fix error with validation code (#956) #958
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I didn't realize self.model_name
was already in there. Just checked this locally and it works great. Ship it when the tests pass :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me, approved
def test_var_defined_is_missing(self): | ||
var = Var(self.model, self.context, overrides={}) | ||
var.assert_var_defined('foo', 'bar') | ||
with self.assertRaises(dbt.exceptions.CompilationException): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was raising AttributeError before, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup. I reverted the fix commit and ran the test, and it fails with an AttributeError.
f3ce094
to
50efa65
Compare
We already set the model's name properly inside the class's
__init__
, so we don't need to figure it out again, we can just use that.