Skip to content

Commit

Permalink
fix syntax errors
Browse files Browse the repository at this point in the history
  • Loading branch information
emlys committed Nov 9, 2023
1 parent 0891e97 commit 3ad9f01
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/natcap/invest/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,6 @@ def read_csv_to_dataframe(path, **kwargs):
try:
df = pandas.read_csv(
path,
index_col=False,
**{
'index_col': False,
'sep': None,
Expand Down
2 changes: 1 addition & 1 deletion src/natcap/invest/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ def get_validated_dataframe(csv_path, columns=None, rows=None, index_col=None,
elif col_spec['type'] == 'boolean':
df[col] = df[col].astype('boolean')
else:
raise ValueError(f'Unknown type: {col_spec['type']}')
raise ValueError(f"Unknown type: {col_spec['type']}")
except Exception as err:
raise ValueError(
f'Value(s) in the "{col}" column could not be interpreted '
Expand Down
2 changes: 1 addition & 1 deletion tests/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,7 @@ def test_boolean_type_columns(self):
csv_file,
columns={
'index': {'type': 'freestyle_string'},
'h1': {'type': 'bool', 'na_allowed': True}})
'h1': {'type': 'boolean', 'na_allowed': True}})
self.assertEqual(df['h1'][0], True)
self.assertEqual(df['h1'][1], False)
# empty values are returned as pandas.NA
Expand Down

0 comments on commit 3ad9f01

Please sign in to comment.