You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Operations do not currently support ref or source method calls.
An exception is raised when ref is used:
2019-06-05 16:47:27,534 (MainThread): Encountered an error while running operation: Compilation Error in macro say_hi (macros/my-op.sql)
argument of type 'NoneType' is not iterable
2019-06-05 16:47:27,534 (MainThread):
Traceback (most recent call last):
File "/Users/drew/fishtown/dbt/core/dbt/clients/jinja.py", line 104, in call
return macro(*args, **kwargs)
File "/Users/drew/fishtown/dbt/env/lib/python3.7/site-packages/jinja2/runtime.py", line 575, in __call__
return self._invoke(arguments, autoescape)
File "/Users/drew/fishtown/dbt/env/lib/python3.7/site-packages/jinja2/asyncsupport.py", line 110, in _invoke
return original_invoke(self, arguments, autoescape)
File "/Users/drew/fishtown/dbt/env/lib/python3.7/site-packages/jinja2/runtime.py", line 579, in _invoke
rv = self._func(*arguments)
File "dbt-a67bac59d05187e871611b73", line 41, in macro
to_string(environment.call(context, (undefined(name='ref') if l_2_ref is missing else l_2_ref), 'idk')),
File "/Users/drew/fishtown/dbt/env/lib/python3.7/site-packages/jinja2/sandbox.py", line 438, in call
return __context.call(__obj, *args, **kwargs)
File "/Users/drew/fishtown/dbt/env/lib/python3.7/site-packages/jinja2/runtime.py", line 262, in call
return __obj(*args, **kwargs)
File "/Users/drew/fishtown/dbt/core/dbt/context/runtime.py", line 44, in do_ref
if target_model_id not in model.get('depends_on', {}).get('nodes'):
TypeError: argument of type 'NoneType' is not iterable
An exception is also raised when source() is used:
2019-06-05 16:48:52,545 (MainThread): Encountered an uncaught exception while running operation: 'ParsedMacro' object has no attribute 'sources'
2019-06-05 16:48:52,545 (MainThread):
Traceback (most recent call last):
File "/Users/drew/fishtown/dbt/core/dbt/task/run_operation.py", line 44, in run
result = self._run_unsafe()
File "/Users/drew/fishtown/dbt/core/dbt/task/run_operation.py", line 37, in _run_unsafe
manifest=manifest
File "/Users/drew/fishtown/dbt/core/dbt/adapters/base/impl.py", line 894, in execute_macro
result = macro_function(**kwargs)
File "/Users/drew/fishtown/dbt/core/dbt/clients/jinja.py", line 104, in call
return macro(*args, **kwargs)
File "/Users/drew/fishtown/dbt/env/lib/python3.7/site-packages/jinja2/runtime.py", line 575, in __call__
return self._invoke(arguments, autoescape)
File "/Users/drew/fishtown/dbt/env/lib/python3.7/site-packages/jinja2/asyncsupport.py", line 110, in _invoke
return original_invoke(self, arguments, autoescape)
File "/Users/drew/fishtown/dbt/env/lib/python3.7/site-packages/jinja2/runtime.py", line 579, in _invoke
rv = self._func(*arguments)
File "dbt-d96473c053fb049fa5d01868", line 41, in macro
to_string(environment.call(context, (undefined(name='source') if l_2_source is missing else l_2_source), 'idk', 'id')),
File "/Users/drew/fishtown/dbt/env/lib/python3.7/site-packages/jinja2/sandbox.py", line 438, in call
return __context.call(__obj, *args, **kwargs)
File "/Users/drew/fishtown/dbt/env/lib/python3.7/site-packages/jinja2/runtime.py", line 262, in call
return __obj(*args, **kwargs)
File "/Users/drew/fishtown/dbt/core/dbt/context/runtime.py", line 81, in do_source
model.sources.append([source_name, table_name])
File "/Users/drew/fishtown/dbt/core/dbt/api/object.py", line 125, in __getattr__
).format(type(self).__name__, name))
AttributeError: 'ParsedMacro' object has no attribute 'sources'
Results
dbt raised an exception, whereas I expected dbt to interpolate model/source relation representations.
I am interested in supporting string interpolation of ref and source function calls -- it is less important that these functions actually build edges -- these Operations will not show up in the docs, and we do not need to invoke Operations that depend on a ref/source, for instance.
Issue
Issue description
Operations do not currently support
ref
orsource
method calls.An exception is raised when
ref
is used:An exception is also raised when
source()
is used:Results
dbt raised an exception, whereas I expected dbt to interpolate model/source relation representations.
System information
The output of
dbt --version
:The operating system you're running on: osx
The python version you're using (probably the output of
python --version
) 3.7Steps to reproduce
Create a model and a source:
models/my_source.yml
models/my_model.sql
Create and run an operation
The text was updated successfully, but these errors were encountered: