slidoapp / dbt-coverage

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

Fix case when table.original_file_path is None #51

Closed moreaupascal56 closed 1 year ago

moreaupascal56 commented 1 year ago

Hello, first thanks for the package I think this can be very useful as more and more dbt projects become matures. There was a bug because table.original_file_path is sometimes equal to None and None.startswith does not work. So I just added a continue if clause if the table.original_file_path is equal to None.

Error Log:

  File "/Users/user/Library/Caches/pypoetry/virtualenvs/venv/lib/python3.8/site-packages/dbt_coverage/__init__.py", line 132, in filter_catalog
    if table.original_file_path.startswith(path):
AttributeError: 'NoneType' object has no attribute 'startswith'

The fix is tested successfully locally :)

fixes #52