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

Improved memory efficiency in read_frame #96

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
Drop usage of f-strings for backward compatibility
  • Loading branch information
wkschwartz committed Apr 2, 2018
commit 59319fc6d880eb40848503255a4e02e01d13f51e
4 changes: 2 additions & 2 deletions django_pandas/io.py
Original file line number Diff line number Diff line change
@@ -103,7 +103,7 @@ def _get_dtypes(fields_to_dtypes, fields, fieldnames):
f2d.update(fields_to_dtypes)
for k, v in f2d.items():
if not issubclass(k, django.db.models.fields.Field):
raise TypeError(f'Expected a type of field, not {k!r}')
raise TypeError('Expected a type of field, not {!r}'.format(k))
if not isinstance(v, np.dtype):
f2d[k] = np.dtype(v)
for field, name in zip(fields, fieldnames):
@@ -256,7 +256,7 @@ def read_frame(qs, fieldnames=(), index_col=None, coerce_float=False,

if compress:
if not isinstance(compress, (bool, Mapping)):
raise TypeError(f'Ambiguous compress argument: {compress!r}')
raise TypeError('Ambiguous compress argument: {!r}'.format(compress))
if not isinstance(compress, Mapping):
compress = {}
dtype = _get_dtypes(compress, fields, fieldnames)