Skip to content

Commit

Permalink
fix: fix crash with additional array of strings present in data
Browse files Browse the repository at this point in the history
  • Loading branch information
yshalenyk committed May 19, 2021
1 parent 06c65b6 commit 4e73c70
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
@@ -1,6 +1,6 @@
[flake8]
max-line-length = 119
max-complexity = 25
max-complexity = 26
select = B,C,E,F,W,T4,B9
# F821 global _ for localization
ignore = E501, W291, F401, F821
Expand Down
14 changes: 12 additions & 2 deletions spoonbill/stats.py
Expand Up @@ -219,14 +219,24 @@ def process_items(self, releases, with_preview=True):
)
)
elif isinstance(item, list):
abs_pointer = separator.join([abs_path, key])
if not isinstance(item[0], dict) and not item_type:
LOGGER.warning(
_("Detected additional column: {} in {} table").format(abs_pointer, root.name)
)
item_type = JOINABLE
self.current_table.add_column(
pointer,
JOINABLE,
additional=True,
abs_path=abs_pointer,
)
if item_type == JOINABLE:
abs_pointer = separator.join([abs_path, key])
self.current_table.inc_column(abs_pointer, pointer)
if with_preview and count < PREVIEW_ROWS:
value = JOINABLE_SEPARATOR.join(item)
self.current_table.set_preview_path(abs_pointer, pointer, value, self.table_threshold)
elif self.current_table.is_root or self.current_table.is_combined:
abs_pointer = separator.join([abs_path, key])
for value in item:
to_analyze.append(
(
Expand Down

0 comments on commit 4e73c70

Please sign in to comment.