Skip to content

Commit

Permalink
update the migration code
Browse files Browse the repository at this point in the history
  • Loading branch information
hannanabdul55 committed Jul 6, 2020
1 parent c66128e commit 6f22018
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions code/validation/forecast_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ def remove_cols_2(df):
Migration function to extract only the specified columns in teh DataFrame
"""
cols_to_keep = [

'location',
'target',
'type',
Expand Down Expand Up @@ -65,7 +64,7 @@ def migrate_to(data_dir, version):
csv.unlink()
else:
print('Writing file %s' % csv.name)
df.to_csv(csv)
df.to_csv(csv, index=False)
else:
print('%s has not changed.' % csv.name)
except Exception as e:
Expand All @@ -85,7 +84,7 @@ def migrate_to(data_dir, version):
print('forecast_migration.py -v <version>')
sys.exit()
elif opt in ("-v", "--version"):
version = arg
version = int(arg)
elif opt in ("-d", "--data-dir"):
data_dir = arg
res = migrate_to(data_dir, version)
Expand Down

0 comments on commit 6f22018

Please sign in to comment.