Skip to content

Commit 18037c8

Browse files
committed
Merge branch 'development'
2 parents cb84302 + 7be3966 commit 18037c8

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Development
44

5+
## 0.2.4 (2020-01-03)
6+
7+
* Fixed several issues with the usage of ``dict.keys`` and Python 3
8+
59
## 0.2.3 (2020-01-02)
610

711
* Fixed the wrong cStringIO import for Python 3

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ The ``clear`` provider will set a database field to ``null``.
148148
**Arguments:** none
149149

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

153153
* ``fake.first_name``
154154
* ``fake.street_name``

pganonymizer/utils.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def anonymize_tables(connection, definitions, verbose=False):
2222
:param bool verbose: Display logging information and a progress bar.
2323
"""
2424
for definition in definitions:
25-
table_name = definition.keys()[0]
25+
table_name = list(definition.keys())[0]
2626
logging.info('Found table definition "%s"', table_name)
2727
table_definition = definition[table_name]
2828
columns = table_definition.get('fields', [])
@@ -92,7 +92,7 @@ def row_matches_excludes(row, excludes=None):
9292
"""
9393
excludes = excludes if excludes else []
9494
for definition in excludes:
95-
column = definition.keys()[0]
95+
column = list(definition.keys())[0]
9696
for exclude in definition.get(column, []):
9797
pattern = re.compile(exclude, re.IGNORECASE)
9898
if pattern.match(row[column]):
@@ -209,7 +209,7 @@ def get_column_dict(columns):
209209
"""
210210
column_dict = {}
211211
for definition in columns:
212-
column_name = definition.keys()[0]
212+
column_name = list(definition.keys())[0]
213213
column_dict[column_name] = None
214214
return column_dict
215215

@@ -233,7 +233,7 @@ def get_column_values(row, columns):
233233
"""
234234
column_dict = {}
235235
for definition in columns:
236-
column_name = definition.keys()[0]
236+
column_name = list(definition.keys())[0]
237237
column_definition = definition[column_name]
238238
provider_config = column_definition.get('provider')
239239
orig_value = row.get(column_name)

pganonymizer/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# -*- coding: utf-8 -*-
22

3-
__version__ = '0.2.3'
3+
__version__ = '0.2.4'

0 commit comments

Comments
 (0)