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

Propagate ParserMacroCapture undefineds into the calls (#1424) #1425

Merged
merged 1 commit into from
Apr 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/dbt/clients/jinja.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def __getattr__(self, name):
return self

def __call__(self, *args, **kwargs):
return True
return self

return ParserMacroCapture

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{% for x in no_such_dependency.no_such_method() %}
{% endfor %}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import dbt.config
import dbt.exceptions


class TestSimpleDependency(DBTIntegrationTest):

@property
Expand Down Expand Up @@ -45,6 +46,25 @@ def test_postgres_local_dependency(self):
)


class TestMissingDependency(DBTIntegrationTest):
@property
def schema(self):
return "local_dependency_006"

@property
def models(self):
return "test/integration/006_simple_dependency_test/sad_iteration_models"

@use_profile('postgres')
def test_postgres_missing_dependency(self):
# dbt should raise a dbt exception, not raise a parse-time TypeError.
with self.assertRaises(dbt.exceptions.Exception) as exc:
self.run_dbt(['compile'])
message = str(exc.exception)
self.assertIn('no_such_dependency', message)
self.assertIn('is undefined', message)


class TestSimpleDependencyWithSchema(TestSimpleDependency):
@property
def project_config(self):
Expand Down