Skip to content

Commit

Permalink
Merge pull request #1425 from fishtown-analytics/fix/propagate-undefi…
Browse files Browse the repository at this point in the history
…ned-to-calls

Propagate ParserMacroCapture undefineds into the calls (#1424)
  • Loading branch information
beckjake authored Apr 30, 2019
2 parents f587efd + 78c13d2 commit a4e5a5a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
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

0 comments on commit a4e5a5a

Please sign in to comment.