Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
hkage committed Jan 25, 2021
2 parents d2fb3bd + eec374d commit 40800e0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
[settings]
line_length=120
multi_line_output=0
sections=FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,PGA,LOCALFOLDER
default_section=THIRDPARTY
known_pga=pganonymizer
no_lines_before=LOCALFOLDER

6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

## Development

## 0.3.2 (2021-01-25)

* [#15](https://github.com/rheinwerk-verlag/postgresql-anonymizer/pull/15): Fix for exclude bug ([abhinavvaidya90](https://github.com/abhinavvaidya90))

## 0.3.1 (2020-12-04)

* [#13](https://github.com/rheinwerk-verlag/postgresql-anonymizer/pull/13>): Fixed a syntax error if no truncated tables are defined ([ray-man](https://github.com/ray-man>))
* [#13](https://github.com/rheinwerk-verlag/postgresql-anonymizer/pull/13): Fixed a syntax error if no truncated tables are defined ([ray-man](https://github.com/ray-man))

## 0.3.0 (2020-02-11)

Expand Down
1 change: 0 additions & 1 deletion pganonymizer/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from pganonymizer.exceptions import InvalidProvider, InvalidProviderArgument


PROVIDERS = []

fake_data = Faker()
Expand Down
4 changes: 2 additions & 2 deletions pganonymizer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def row_matches_excludes(row, excludes=None):
column = list(definition.keys())[0]
for exclude in definition.get(column, []):
pattern = re.compile(exclude, re.IGNORECASE)
if pattern.match(row[column]):
if row[column] is not None and pattern.match(row[column]):
return True
return False

Expand Down Expand Up @@ -188,7 +188,7 @@ def data2csv(data):
"""
buf = StringIO()
writer = csv.writer(buf, delimiter=COPY_DB_DELIMITER, lineterminator='\n', quotechar='~')
[writer.writerow([(x is None and '\\N' or x) for x in row]) for row in data]
[writer.writerow([(x is None and '\\N' or (x.strip() if type(x) == str else x)) for x in row]) for row in data]
buf.seek(0)
return buf

Expand Down
2 changes: 1 addition & 1 deletion pganonymizer/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-

__version__ = '0.3.1'
__version__ = '0.3.2'

0 comments on commit 40800e0

Please sign in to comment.