Skip to content
Snippets Groups Projects
Commit 4f3c8573 authored by David Schaefer's avatar David Schaefer
Browse files

bugfix in casting function lookup

parent fb3e8f05
No related branches found
No related tags found
1 merge request!12fix several new reader issues
...@@ -60,11 +60,14 @@ def _castRow(row: Dict[str, str]) -> Dict[str, Any]: ...@@ -60,11 +60,14 @@ def _castRow(row: Dict[str, str]) -> Dict[str, Any]:
cast values to the data type given in 'types' cast values to the data type given in 'types'
""" """
out = {} out = {}
for k, v in row.items(): keys = pd.Index(row.keys())
for k, func in CONFIG_TYPES.items():
key = keys[keys.str.match(k)][0]
value = row[key]
try: try:
out[k] = CONFIG_TYPES[k](v) out[key] = func(value)
except: except:
_raise(row, ValueError, f"invalid value: v") _raise(row, ValueError, f"invalid value: '{value}'")
return out return out
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment