Skip to content

Commit

Permalink
Regression in tests caused by pandas fixed by pandas 2.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
willu47 committed Dec 15, 2023
1 parent f9ffec2 commit dcd5a49
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ install_requires =
xlrd
pyyaml
pydot
pandas>=1.1,<2.1
pandas>=2.1.4
Amply>=0.1.6
networkx
flatten_dict
Expand Down
7 changes: 5 additions & 2 deletions src/otoole/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,11 @@ def _expand_defaults(
df_default["VALUE"] = default_values[name]

# combine result and default value dataframe
df = pd.concat([data, df_default])
df = df[~df.index.duplicated(keep="first")]
if not data.empty:
df = pd.concat([data, df_default])
df = df[~df.index.duplicated(keep="first")]
else:
df = df_default
df = df.sort_index()
output[name] = df

Expand Down
2 changes: 1 addition & 1 deletion tests/test_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def result_data(region):
input_data_single_index_empty(region),
]
parameter_test_data_ids = [
"multi_index_no_defaluts",
"multi_index_no_defaults",
"multi_index",
"multi_index_empty",
"single_index",
Expand Down

0 comments on commit dcd5a49

Please sign in to comment.