Skip to content

Commit 3203692

Browse files
committed
fix(compare comply): BodyCells with some properties corrected to return list of strings
1 parent da850d1 commit 3203692

File tree

1 file changed

+44
-55
lines changed

1 file changed

+44
-55
lines changed

ibm_watson/compare_comply_v1.py

Lines changed: 44 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,12 +1235,20 @@ class BodyCells(object):
12351235
location in the current table.
12361236
:attr int column_index_end: (optional) The `end` index of this cell's `column`
12371237
location in the current table.
1238-
:attr list[RowHeaderIds] row_header_ids: (optional)
1239-
:attr list[RowHeaderTexts] row_header_texts: (optional)
1240-
:attr list[RowHeaderTextsNormalized] row_header_texts_normalized: (optional)
1241-
:attr list[ColumnHeaderIds] column_header_ids: (optional)
1242-
:attr list[ColumnHeaderTexts] column_header_texts: (optional)
1243-
:attr list[ColumnHeaderTextsNormalized] column_header_texts_normalized: (optional)
1238+
:attr list[str] row_header_ids: (optional) An array that contains the `id` value of a
1239+
row header that is applicable to this body cell.
1240+
:attr list[str] row_header_texts: (optional) An array that contains the `text` value
1241+
of a row header that is applicable to this body cell.
1242+
:attr list[str] row_header_texts_normalized: (optional) If you provide customization
1243+
input, the normalized version of the row header texts according to the customization;
1244+
otherwise, the same value as `row_header_texts`.
1245+
:attr list[str] column_header_ids: (optional) An array that contains the `id` value of
1246+
a column header that is applicable to the current cell.
1247+
:attr list[str] column_header_texts: (optional) An array that contains the `text`
1248+
value of a column header that is applicable to the current cell.
1249+
:attr list[str] column_header_texts_normalized: (optional) If you provide
1250+
customization input, the normalized version of the column header texts according to
1251+
the customization; otherwise, the same value as `column_header_texts`.
12441252
:attr list[Attribute] attributes: (optional)
12451253
"""
12461254

@@ -1275,13 +1283,20 @@ def __init__(self,
12751283
`column` location in the current table.
12761284
:param int column_index_end: (optional) The `end` index of this cell's `column`
12771285
location in the current table.
1278-
:param list[RowHeaderIds] row_header_ids: (optional)
1279-
:param list[RowHeaderTexts] row_header_texts: (optional)
1280-
:param list[RowHeaderTextsNormalized] row_header_texts_normalized: (optional)
1281-
:param list[ColumnHeaderIds] column_header_ids: (optional)
1282-
:param list[ColumnHeaderTexts] column_header_texts: (optional)
1283-
:param list[ColumnHeaderTextsNormalized] column_header_texts_normalized:
1284-
(optional)
1286+
:param list[str] row_header_ids: (optional) An array that contains the `id` value
1287+
of a row header that is applicable to this body cell.
1288+
:param list[str] row_header_texts: (optional) An array that contains the `text`
1289+
value of a row header that is applicable to this body cell.
1290+
:param list[str] row_header_texts_normalized: (optional) If you provide
1291+
customization input, the normalized version of the row header texts according to
1292+
the customization; otherwise, the same value as `row_header_texts`.
1293+
:param list[str] column_header_ids: (optional) An array that contains the `id`
1294+
value of a column header that is applicable to the current cell.
1295+
:param list[str] column_header_texts: (optional) An array that contains the `text`
1296+
value of a column header that is applicable to the current cell.
1297+
:param list[str] column_header_texts_normalized: (optional) If you provide
1298+
customization input, the normalized version of the column header texts according
1299+
to the customization; otherwise, the same value as `column_header_texts`.
12851300
:param list[Attribute] attributes: (optional)
12861301
"""
12871302
self.cell_id = cell_id
@@ -1330,35 +1345,19 @@ def _from_dict(cls, _dict):
13301345
if 'column_index_end' in _dict:
13311346
args['column_index_end'] = _dict.get('column_index_end')
13321347
if 'row_header_ids' in _dict:
1333-
args['row_header_ids'] = [
1334-
RowHeaderIds._from_dict(x)
1335-
for x in (_dict.get('row_header_ids'))
1336-
]
1348+
args['row_header_ids'] = _dict.get('row_header_ids')
13371349
if 'row_header_texts' in _dict:
1338-
args['row_header_texts'] = [
1339-
RowHeaderTexts._from_dict(x)
1340-
for x in (_dict.get('row_header_texts'))
1341-
]
1350+
args['row_header_texts'] = _dict.get('row_header_texts')
13421351
if 'row_header_texts_normalized' in _dict:
1343-
args['row_header_texts_normalized'] = [
1344-
RowHeaderTextsNormalized._from_dict(x)
1345-
for x in (_dict.get('row_header_texts_normalized'))
1346-
]
1352+
args['row_header_texts_normalized'] = _dict.get(
1353+
'row_header_texts_normalized')
13471354
if 'column_header_ids' in _dict:
1348-
args['column_header_ids'] = [
1349-
ColumnHeaderIds._from_dict(x)
1350-
for x in (_dict.get('column_header_ids'))
1351-
]
1355+
args['column_header_ids'] = _dict.get('column_header_ids')
13521356
if 'column_header_texts' in _dict:
1353-
args['column_header_texts'] = [
1354-
ColumnHeaderTexts._from_dict(x)
1355-
for x in (_dict.get('column_header_texts'))
1356-
]
1357+
args['column_header_texts'] = _dict.get('column_header_texts')
13571358
if 'column_header_texts_normalized' in _dict:
1358-
args['column_header_texts_normalized'] = [
1359-
ColumnHeaderTextsNormalized._from_dict(x)
1360-
for x in (_dict.get('column_header_texts_normalized'))
1361-
]
1359+
args['column_header_texts_normalized'] = _dict.get(
1360+
'column_header_texts_normalized')
13621361
if 'attributes' in _dict:
13631362
args['attributes'] = [
13641363
Attribute._from_dict(x) for x in (_dict.get('attributes'))
@@ -1387,35 +1386,25 @@ def _to_dict(self):
13871386
'column_index_end') and self.column_index_end is not None:
13881387
_dict['column_index_end'] = self.column_index_end
13891388
if hasattr(self, 'row_header_ids') and self.row_header_ids is not None:
1390-
_dict['row_header_ids'] = [
1391-
x._to_dict() for x in self.row_header_ids
1392-
]
1389+
_dict['row_header_ids'] = self.row_header_ids
13931390
if hasattr(self,
13941391
'row_header_texts') and self.row_header_texts is not None:
1395-
_dict['row_header_texts'] = [
1396-
x._to_dict() for x in self.row_header_texts
1397-
]
1392+
_dict['row_header_texts'] = self.row_header_texts
13981393
if hasattr(self, 'row_header_texts_normalized'
13991394
) and self.row_header_texts_normalized is not None:
1400-
_dict['row_header_texts_normalized'] = [
1401-
x._to_dict() for x in self.row_header_texts_normalized
1402-
]
1395+
_dict[
1396+
'row_header_texts_normalized'] = self.row_header_texts_normalized
14031397
if hasattr(self,
14041398
'column_header_ids') and self.column_header_ids is not None:
1405-
_dict['column_header_ids'] = [
1406-
x._to_dict() for x in self.column_header_ids
1407-
]
1399+
_dict['column_header_ids'] = self.column_header_ids
14081400
if hasattr(
14091401
self,
14101402
'column_header_texts') and self.column_header_texts is not None:
1411-
_dict['column_header_texts'] = [
1412-
x._to_dict() for x in self.column_header_texts
1413-
]
1403+
_dict['column_header_texts'] = self.column_header_texts
14141404
if hasattr(self, 'column_header_texts_normalized'
14151405
) and self.column_header_texts_normalized is not None:
1416-
_dict['column_header_texts_normalized'] = [
1417-
x._to_dict() for x in self.column_header_texts_normalized
1418-
]
1406+
_dict[
1407+
'column_header_texts_normalized'] = self.column_header_texts_normalized
14191408
if hasattr(self, 'attributes') and self.attributes is not None:
14201409
_dict['attributes'] = [x._to_dict() for x in self.attributes]
14211410
return _dict

0 commit comments

Comments
 (0)