Skip to content
Snippets Groups Projects
Commit cd1ee89d authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

MAINT: do not convert to string if target datatype is correct

parent 603af10b
No related branches found
No related tags found
2 merge requests!130Release v0.14.0,!127F int dt
Pipeline #47047 failed
This commit is part of merge request !127. Comments created here will be created in the context of that merge request.
......@@ -63,8 +63,7 @@ from ..exceptions import (AmbiguousEntityError, AuthorizationError,
UniqueNamesError, UnqualifiedParentsError,
UnqualifiedPropertiesError)
from .datatype import (BOOLEAN, DATETIME, DOUBLE, INTEGER, TEXT,
get_list_datatype,
is_list_datatype, is_reference)
get_list_datatype, is_list_datatype, is_reference)
from .state import State
from .timezone import TimeZone
from .utils import uuid, xml2str
......@@ -1503,7 +1502,12 @@ def _parse_value(datatype, value):
return float(value)
if datatype == INTEGER:
return int(str(value))
if isinstance(value, int):
return value
elif isinstance(value, float):
return int(value)
else:
return int(str(value))
if datatype == BOOLEAN:
if str(value).lower() == "true":
......
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