Skip to content

Commit

Permalink
fix(compare comply): KeyValuePair has a list of value
Browse files Browse the repository at this point in the history
  • Loading branch information
ehdsouza committed Aug 21, 2019
1 parent 3203692 commit 3b76f2f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ibm_watson/compare_comply_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -4072,15 +4072,15 @@ class KeyValuePair(object):
Key-value pairs detected across cell boundaries.
:attr Key key: (optional) A key in a key-value pair.
:attr Value value: (optional) A value in a key-value pair.
:attr list[Value] value: (optional) A list of values in a key-value pair.
"""

def __init__(self, key=None, value=None):
"""
Initialize a KeyValuePair object.
:param Key key: (optional) A key in a key-value pair.
:param Value value: (optional) A value in a key-value pair.
:param list[Value] value: (optional) A list of values in a key-value pair.
"""
self.key = key
self.value = value
Expand All @@ -4098,7 +4098,7 @@ def _from_dict(cls, _dict):
if 'key' in _dict:
args['key'] = Key._from_dict(_dict.get('key'))
if 'value' in _dict:
args['value'] = Value._from_dict(_dict.get('value'))
args['value'] = [Value._from_dict(x) for x in (_dict.get('value'))]
return cls(**args)

def _to_dict(self):
Expand All @@ -4107,7 +4107,7 @@ def _to_dict(self):
if hasattr(self, 'key') and self.key is not None:
_dict['key'] = self.key._to_dict()
if hasattr(self, 'value') and self.value is not None:
_dict['value'] = self.value._to_dict()
_dict['value'] = [x._to_dict() for x in self.value]
return _dict

def __str__(self):
Expand Down

0 comments on commit 3b76f2f

Please sign in to comment.