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 30, 2021
1 parent 5982245 commit 22eac70
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 @@ -135,7 +135,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:
raise ValueError(f"Missing expected columns for {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 22eac70

Please sign in to comment.