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
A user reports seeing this error when trying to parse their project after upgrading to v0.20.0:
Encountered an error:
argument of type 'NoneType' is not iterable
This is the stacktrace:
File "/usr/local/Cellar/dbt/0.20.0_1/libexec/lib/python3.8/site-packages/dbt/parser/schemas.py", line 560, in check_format_version
if 'version' not in yaml_dct:
TypeError: argument of type 'NoneType' is not iterable
It's pretty hard to imagine yaml_from_file returning None. I've tried a couple different things to trip this error (an empty .yml file, malformed contents, simply the word 'None'), but none (hah) of my attemps has worked. The only way I've managed to reproduce it is by stepping directly into the validate_yaml or yaml_from_file method calls and setting the yaml dictionary to None.
One important hint: The user reports that this project runs fine on earlier versions of dbt. It's only with the upgrade to v0.20.0 that they started seeing this error.
Steps To Reproduce
???
Expected behavior
Definitely not this error!
The output of dbt --version:
/usr/local/Cellar/dbt/0.20.0_1/
(i.e. dbt v0.20.0 installed via Homebrew)
The text was updated successfully, but these errors were encountered:
I wanted to take a quick peek at this, and drilling all the way down to our call to the yaml loader, we aren't passing along any None values in dbt. Looking at the PyYaml documentation, this line stands out: "If there are no documents in the stream, it returns None." This, of course, is still very odd.
jtcohen6
changed the title
NoneType yaml file contents in v0.20.0 results in unhelpful error
Full-commented-out yaml file contents return ugly error
Jul 14, 2021
$ dbt --no-partial-parse parse
Running with dbt=0.20.0
14:19:08 | Start parsing.
14:19:08 | Dependencies loaded
14:19:08 | ManifestLoader created
Encountered an error:
argument of type 'NoneType' is not iterable
I think the catch here is, source_file.contents is truthy, but yaml.load() of those contents returns None.
Describe the bug
A user reports seeing this error when trying to parse their project after upgrading to v0.20.0:
This is the stacktrace:
That's very surprising! The error cropping up in this line:
https://github.com/dbt-labs/dbt/blob/f460d275baa4df8cf8713f27e198a3577d6ea71c/core/dbt/parser/schemas.py#L560
Means that
yaml_dct
must be set toNone
, somehow. That method is called here:https://github.com/dbt-labs/dbt/blob/f460d275baa4df8cf8713f27e198a3577d6ea71c/core/dbt/parser/read_files.py#L21-L23
It's pretty hard to imagine
yaml_from_file
returningNone
. I've tried a couple different things to trip this error (an empty.yml
file, malformed contents, simply the word'None'
), but none (hah) of my attemps has worked. The only way I've managed to reproduce it is by stepping directly into thevalidate_yaml
oryaml_from_file
method calls and setting the yaml dictionary toNone
.One important hint: The user reports that this project runs fine on earlier versions of dbt. It's only with the upgrade to v0.20.0 that they started seeing this error.
Steps To Reproduce
???
Expected behavior
Definitely not this error!
The output of
dbt --version
:(i.e. dbt v0.20.0 installed via Homebrew)
The text was updated successfully, but these errors were encountered: