Skip to content

Commit

Permalink
Merge pull request #794 from talumbau/read_csv_egg
Browse files Browse the repository at this point in the history
Propagate read_csv args into read_egg_csv
  • Loading branch information
martinholmer committed Jun 17, 2016
2 parents d7cff8d + 8cc219f commit ba07d6a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions taxcalc/records.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ def _read_data(self, data):
2, 1)

@staticmethod
def _read_egg_csv(vname, fpath):
def _read_egg_csv(vname, fpath, **kwargs):
"""
Read csv file with fpath containing vname data from EGG;
return dict of vname data
Expand All @@ -466,7 +466,7 @@ def _read_egg_csv(vname, fpath):
path_in_egg = os.path.join('taxcalc', fpath)
vname_fname = resource_stream(
Requirement.parse('taxcalc'), path_in_egg)
vname_dict = pd.read_csv(vname_fname)
vname_dict = pd.read_csv(vname_fname, **kwargs)
except (DistributionNotFound, IOError):
msg = 'could not read {} file from EGG'
raise ValueError(msg.format(vname))
Expand Down Expand Up @@ -512,7 +512,8 @@ def _read_blowup(self, blowup_factors):
BF = pd.read_csv(blowup_factors, index_col='YEAR')
else:
BF = Records._read_egg_csv('blowup_factors',
Records.BLOWUP_FACTORS_FILENAME)
Records.BLOWUP_FACTORS_FILENAME,
index_col='YEAR')
else:
msg = ('blowup_factors is not None or a string '
'or a Pandas DataFrame')
Expand Down

0 comments on commit ba07d6a

Please sign in to comment.