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 3, 2020
2 parents cb84302 + 7be3966 commit 18037c8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Development

## 0.2.4 (2020-01-03)

* Fixed several issues with the usage of ``dict.keys`` and Python 3

## 0.2.3 (2020-01-02)

* Fixed the wrong cStringIO import for Python 3
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ The ``clear`` provider will set a database field to ``null``.
**Arguments:** none

``pganonymize`` supports all providers from the Python library Faker_. All you have to do is prefix
the provider with ``faker`` and use the provider function from the Faker library, e.g:
the provider with ``fake`` and then use the function name from the Faker library, e.g:

* ``fake.first_name``
* ``fake.street_name``
Expand Down
8 changes: 4 additions & 4 deletions pganonymizer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def anonymize_tables(connection, definitions, verbose=False):
:param bool verbose: Display logging information and a progress bar.
"""
for definition in definitions:
table_name = definition.keys()[0]
table_name = list(definition.keys())[0]
logging.info('Found table definition "%s"', table_name)
table_definition = definition[table_name]
columns = table_definition.get('fields', [])
Expand Down Expand Up @@ -92,7 +92,7 @@ def row_matches_excludes(row, excludes=None):
"""
excludes = excludes if excludes else []
for definition in excludes:
column = definition.keys()[0]
column = list(definition.keys())[0]
for exclude in definition.get(column, []):
pattern = re.compile(exclude, re.IGNORECASE)
if pattern.match(row[column]):
Expand Down Expand Up @@ -209,7 +209,7 @@ def get_column_dict(columns):
"""
column_dict = {}
for definition in columns:
column_name = definition.keys()[0]
column_name = list(definition.keys())[0]
column_dict[column_name] = None
return column_dict

Expand All @@ -233,7 +233,7 @@ def get_column_values(row, columns):
"""
column_dict = {}
for definition in columns:
column_name = definition.keys()[0]
column_name = list(definition.keys())[0]
column_definition = definition[column_name]
provider_config = column_definition.get('provider')
orig_value = row.get(column_name)
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.2.3'
__version__ = '0.2.4'

0 comments on commit 18037c8

Please sign in to comment.