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

Fix error with validation code (#956) #958

Merged
merged 3 commits into from
Aug 28, 2018
Merged

Conversation

beckjake
Copy link
Contributor

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.

@beckjake beckjake requested a review from cmcarthur August 28, 2018 15:18
@drewbanin drewbanin self-requested a review August 28, 2018 15:18
Copy link
Contributor

@drewbanin drewbanin left a 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 :)

Copy link
Member

@cmcarthur cmcarthur left a 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):
Copy link
Member

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?

Copy link
Contributor Author

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.

@beckjake beckjake force-pushed the var-validate-model-name branch 2 times, most recently from f3ce094 to 50efa65 Compare August 28, 2018 15:46
@beckjake beckjake merged commit 6d6cb20 into development Aug 28, 2018
@beckjake beckjake deleted the var-validate-model-name branch August 28, 2018 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants