slidoapp / dbt-coverage

One-stop-shop for docs and test coverage of dbt projects.
MIT License
197 stars 25 forks source link

Not compatible with `store_failures` on project level #62

Closed Jsturgeo closed 1 year ago

Jsturgeo commented 1 year ago

Discovered that adding the store failures config at a project level causes an error with the dbt-coverage command.

Output (some private naming information redacted):

WARNING:root:original_file_path value not found in manifest for test.<project>.<test_name>
Traceback (most recent call last):
  File "/opt/homebrew/bin/dbt-coverage", line 8, in <module>
    sys.exit(app())
  File "/opt/homebrew/lib/python3.9/site-packages/typer/main.py", line 214, in __call__
    return get_command(self)(*args, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/opt/homebrew/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/homebrew/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/homebrew/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/typer/main.py", line 532, in wrapper
    return callback(**use_params)  # type: ignore
  File "/opt/homebrew/lib/python3.9/site-packages/dbt_coverage/__init__.py", line 885, in compute
    return do_compute(
  File "/opt/homebrew/lib/python3.9/site-packages/dbt_coverage/__init__.py", line 817, in do_compute
    catalog = load_files(project_dir, run_artifacts_dir)
  File "/opt/homebrew/lib/python3.9/site-packages/dbt_coverage/__init__.py", line 720, in load_files
    catalog = load_catalog(project_dir, run_artifacts_dir, manifest)
  File "/opt/homebrew/lib/python3.9/site-packages/dbt_coverage/__init__.py", line 682, in load_catalog
    catalog = Catalog.from_nodes(catalog_nodes.values(), manifest)
  File "/opt/homebrew/lib/python3.9/site-packages/dbt_coverage/__init__.py", line 123, in from_nodes
    tables = [Table.from_node(table, manifest) for table in nodes]
  File "/opt/homebrew/lib/python3.9/site-packages/dbt_coverage/__init__.py", line 123, in <listcomp>
    tables = [Table.from_node(table, manifest) for table in nodes]
  File "/opt/homebrew/lib/python3.9/site-packages/dbt_coverage/__init__.py", line 80, in from_node
    manifest_table["name"].lower(),
TypeError: 'NoneType' object is not subscriptable

Running version 0.3.4 on Mac.

sweco commented 1 year ago

I just released the version 0.3.5 that should fix this, can you please test?