Commit 515628a0783d5bd95eea48c3862ff71a5bfd5d00

Authored by Antoine Goutenoir
1 parent 13943ffa
Exists in master

fix: remove dep on PandasStringIO

Showing 1 changed file with 3 additions and 3 deletions   Show diff stats
flaskr/controllers/main_controller.py
@@ -20,7 +20,7 @@ from flask import ( @@ -20,7 +20,7 @@ from flask import (
20 abort, 20 abort,
21 send_from_directory, 21 send_from_directory,
22 ) 22 )
23 -from pandas.compat import StringIO as PandasStringIO 23 +# from pandas.compat import StringIO as PandasStringIO
24 from wtforms import validators 24 from wtforms import validators
25 from yaml import safe_dump as yaml_dump 25 from yaml import safe_dump as yaml_dump
26 26
@@ -90,7 +90,7 @@ def gather_addresses(from_list, from_file): @@ -90,7 +90,7 @@ def gather_addresses(from_list, from_file):
90 if 'text/csv' == file_mimetype: 90 if 'text/csv' == file_mimetype:
91 91
92 rows_dicts = pandas \ 92 rows_dicts = pandas \
93 - .read_csv(PandasStringIO(file_contents)) \ 93 + .read_csv(StringIO(file_contents)) \
94 .rename(str.lower, axis='columns') \ 94 .rename(str.lower, axis='columns') \
95 .to_dict(orient="row") 95 .to_dict(orient="row")
96 96
@@ -111,7 +111,7 @@ def gather_addresses(from_list, from_file): @@ -111,7 +111,7 @@ def gather_addresses(from_list, from_file):
111 or from_file.filename.endswith('xlsx'): 111 or from_file.filename.endswith('xlsx'):
112 112
113 rows_dicts = pandas \ 113 rows_dicts = pandas \
114 - .read_excel(PandasStringIO(file_contents)) \ 114 + .read_excel(StringIO(file_contents)) \
115 .rename(str.lower, axis='columns') \ 115 .rename(str.lower, axis='columns') \
116 .to_dict(orient="row") 116 .to_dict(orient="row")
117 117