TypeError: 'NoneType' object is not subscriptable
moltar opened this issue · 4 comments
I'm getting the following error. Any ideas? Any steps I can take to help debug?
Resource 1 of 1, models/inventory.sql
Traceback (most recent call last):
File "/usr/local/Cellar/python@3.8/3.8.11/Frameworks/Python.framework/Versions/3.8/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/Cellar/dbt/0.20.1_1/libexec/lib/python3.8/site-packages/dbt_invoke/properties.py", line 460, in _create_property_file
property_file_dict = _structure_property_file_dict(
File "/usr/local/Cellar/dbt/0.20.1_1/libexec/lib/python3.8/site-packages/dbt_invoke/properties.py", line 539, in _structure_property_file_dict
for item in property_file_dict[resource_type_plural][0]['columns']
TypeError: 'NoneType' object is not subscriptable
dbt-invoke | INFO | [DONE] Total: 1, Successes: 0, Failures: 1
I can reproduce this same error if I try to run dbt-invoke properties --models my_model_name
where my_model_name.yml already exists but is completely empty.
In this case, property_file_dict
is the already existing yml file loaded into a dictionary. If my_model_name.yml exists, but is empty, then property_file_dict
will be None, leading to the error in line 539.
Does the empty yml file already exist for you? If so can you delete it and then try again?
Note: If you have many empty yml files to delete you can do that with dbt-invoke properties.delete --models your_model_selectors_here
I can reproduce this same error if I try to run dbt-invoke properties --models my_model_name where my_model_name.yml already exists but is completely empty.
That was the case.
Will try again tomorrow without the empty files.
Thank you for looking into it.
Works without the empty file! Thanks :)
Thanks for confirming!