Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix generic tests returning "TypeError: 'NoneType' object is not subscriptable #64

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions dbt_coverage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ def from_node(node, manifest: Manifest) -> Table:

if original_file_path is None:
logging.warning("original_file_path value not found in manifest for %s", unique_id)

return Table(
unique_id,
# Take table name from manifest.json instead of catalog.json since in catalog.json the
# name is actually an alias in case it is defined.
manifest_table["name"].lower(),
original_file_path,
{col.name: col for col in columns},
)
else:
return Table(
unique_id,
# Take table name from manifest.json instead of catalog.json since in catalog.json the
# name is actually an alias in case it is defined.
manifest_table["name"].lower(),
original_file_path,
{col.name: col for col in columns},
)

def get_column(self, column_name):
return self.columns.get(column_name)
Expand Down Expand Up @@ -120,7 +120,8 @@ def filter_tables(self, model_path_filter: List[str]) -> Catalog:

@staticmethod
def from_nodes(nodes, manifest: Manifest):
tables = [Table.from_node(table, manifest) for table in nodes]
tables_tmp = [Table.from_node(table, manifest) for table in nodes]
tables = [table for table in tables_tmp if table is not None]
return Catalog({table.unique_id: table for table in tables})

def get_table(self, table_id):
Expand Down