Skip to content

Commit 3b76f2f

Browse files
committed
fix(compare comply): KeyValuePair has a list of value
1 parent 3203692 commit 3b76f2f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ibm_watson/compare_comply_v1.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4072,15 +4072,15 @@ class KeyValuePair(object):
40724072
Key-value pairs detected across cell boundaries.
40734073
40744074
:attr Key key: (optional) A key in a key-value pair.
4075-
:attr Value value: (optional) A value in a key-value pair.
4075+
:attr list[Value] value: (optional) A list of values in a key-value pair.
40764076
"""
40774077

40784078
def __init__(self, key=None, value=None):
40794079
"""
40804080
Initialize a KeyValuePair object.
40814081
40824082
:param Key key: (optional) A key in a key-value pair.
4083-
:param Value value: (optional) A value in a key-value pair.
4083+
:param list[Value] value: (optional) A list of values in a key-value pair.
40844084
"""
40854085
self.key = key
40864086
self.value = value
@@ -4098,7 +4098,7 @@ def _from_dict(cls, _dict):
40984098
if 'key' in _dict:
40994099
args['key'] = Key._from_dict(_dict.get('key'))
41004100
if 'value' in _dict:
4101-
args['value'] = Value._from_dict(_dict.get('value'))
4101+
args['value'] = [Value._from_dict(x) for x in (_dict.get('value'))]
41024102
return cls(**args)
41034103

41044104
def _to_dict(self):
@@ -4107,7 +4107,7 @@ def _to_dict(self):
41074107
if hasattr(self, 'key') and self.key is not None:
41084108
_dict['key'] = self.key._to_dict()
41094109
if hasattr(self, 'value') and self.value is not None:
4110-
_dict['value'] = self.value._to_dict()
4110+
_dict['value'] = [x._to_dict() for x in self.value]
41114111
return _dict
41124112

41134113
def __str__(self):

0 commit comments

Comments
 (0)