From 9f56d837a8d33c3618fb9d4663441e2176efe856 Mon Sep 17 00:00:00 2001 From: Dennis Wambua Date: Fri, 27 Jan 2017 10:30:04 +0300 Subject: [PATCH] remove unnecessary assert error Signed-off-by: Dennis Wambua --- onadata/libs/utils/csv_builder.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/onadata/libs/utils/csv_builder.py b/onadata/libs/utils/csv_builder.py index d8c95932d2..887b753ac4 100644 --- a/onadata/libs/utils/csv_builder.py +++ b/onadata/libs/utils/csv_builder.py @@ -340,7 +340,6 @@ def _reindex(cls, key, value, ordered_columns, row, data_dictionary, """ def get_ordered_repeat_value(xpath, repeat_value): children = data_dictionary.get_child_elements(xpath) - count_keys = len(repeat_value.keys()) item = OrderedDict() for elem in children: @@ -348,10 +347,6 @@ def get_ordered_repeat_value(xpath, repeat_value): if xp in repeat_value: item[xp] = repeat_value[xp] - count_ordered = len(item.keys()) - assert count_keys == count_ordered, \ - "Only %s of %s were found" % (count_ordered, count_keys) - return item d = {} @@ -366,10 +361,7 @@ def get_ordered_repeat_value(xpath, repeat_value): # this dict if type(item) is dict: # order repeat according to xform order - try: - item = get_ordered_repeat_value(key, item) - except AssertionError: - pass + item = get_ordered_repeat_value(key, item) for nested_key, nested_val in item.iteritems(): # given the key "children/details" and nested_key/