Skip to content

Commit

Permalink
check the input data for "unit"
Browse files Browse the repository at this point in the history
  • Loading branch information
behnam-zakeri committed Apr 3, 2020
1 parent 9ca3acd commit 0663c65
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion message_ix/macro.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def validate(kind, values, df):
cols = MACRO_DATA_FOR_DERIVATION[name]
else:
cols = MACRO_ITEMS[name]['idx_sets']
col_diff = set(cols) - set(df.columns)
col_diff = set(cols + ['unit']) - set(df.columns)
if col_diff:
msg = 'Missing expected columns for {}: {}'
raise ValueError(msg.format(name, col_diff))
Expand Down
2 changes: 1 addition & 1 deletion message_ix/tests/test_macro.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def test_config(westeros_solved):

# removing a column from config and testing
data = c.data.copy()
data['config'] = c.data['config'][['node', 'sector']]
data['config'] = c.data['config'][['node', 'sector']]
try:
macro.Calculate(s, data)
except KeyError as error:
Expand Down

0 comments on commit 0663c65

Please sign in to comment.