🐛 fix(base.py): handle cases where value is not a valid int or float to prevent ValueError and assign the original value instead
This commit is contained in:
parent
8f20105b4b
commit
6abd5d5343
1 changed files with 10 additions and 4 deletions
|
|
@ -216,10 +216,16 @@ class Vertex:
|
|||
}
|
||||
elif isinstance(_value, dict):
|
||||
params[key] = _value
|
||||
elif value.get("type") == "int":
|
||||
params[key] = int(value.get("value"))
|
||||
elif value.get("type") == "float":
|
||||
params[key] = float(value.get("value"))
|
||||
elif value.get("type") == "int" and value.get("value") is not None:
|
||||
try:
|
||||
params[key] = int(value.get("value"))
|
||||
except ValueError:
|
||||
params[key] = value.get("value")
|
||||
elif value.get("type") == "float" and value.get("value") is not None:
|
||||
try:
|
||||
params[key] = float(value.get("value"))
|
||||
except ValueError:
|
||||
params[key] = value.get("value")
|
||||
else:
|
||||
params[key] = value.get("value")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue