Skip to content

Commit

Permalink
fix: Skip over dropped columsn when filtering for text columns
Browse files Browse the repository at this point in the history
Check  and skip if data_type is None. This can happen if a column has been dropped in Postgres.

Fix #177 

Co-authored-by: Eric Hilfer <[email protected]>
  • Loading branch information
ehilfer and Eric Hilfer authored Jan 28, 2022
1 parent 1cc5af2 commit 6bb40ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion piicatcher/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def _filter_text_columns(column_list: List[CatColumn]) -> List[CatColumn]:
matched_set = set()
for regex in data_type_regex:
matched_set |= set(
list(filter(lambda m: regex.search(m.data_type) is not None, column_list,))
list(filter(lambda m: m.data_type is not None and regex.search(m.data_type) is not None, column_list))
)

LOGGER.debug(f"{len(matched_set)} text columns found")
Expand Down

0 comments on commit 6bb40ca

Please sign in to comment.