Skip to content

Commit 69a39b8

Browse files
committed
polish
1 parent bac9e80 commit 69a39b8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

splitio/client/input_validator.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,8 +595,7 @@ def valid_properties(properties, source):
595595
if element is None:
596596
continue
597597

598-
if not isinstance(element, str) and not isinstance(element, Number) \
599-
and not isinstance(element, bool):
598+
if not _check_element_type(element):
600599
_LOGGER.warning('%s: Property %s is of invalid type. Setting value to None', source, element)
601600
element = None
602601

@@ -616,6 +615,13 @@ def valid_properties(properties, source):
616615
' when processed', source)
617616
return True, valid_properties if len(valid_properties) else None, size
618617

618+
def _check_element_type(element):
619+
if not isinstance(element, str) and not isinstance(element, Number) \
620+
and not isinstance(element, bool):
621+
return False
622+
623+
return True
624+
619625
def validate_pluggable_adapter(config):
620626
"""
621627
Check if pluggable adapter contains the expected method signature

0 commit comments

Comments
 (0)