Skip to content

Commit

Permalink
#356 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolay-r committed Jul 4, 2022
1 parent 3406acd commit 5728d33
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions arekit/common/data/views/samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,19 @@ def iter_rows_linked_by_text_opinions(self):

linked = []

current_doc_id = undefined
current_opinion_id = undefined

for row_index, sample_id in enumerate(self._storage.iter_column_values(const.ID)):
sample_id = str(sample_id)

doc_id = self._storage.get_cell(row_index=row_index, column_name=const.DOC_ID)
opinion_id = self.__row_ids_provider.parse_opinion_in_sample_id(sample_id)

if current_doc_id != undefined and current_opinion_id != undefined:
if doc_id != current_doc_id or opinion_id != current_opinion_id:
if current_opinion_id != undefined:
if opinion_id != current_opinion_id:
yield linked
linked = []
current_opinion_id = opinion_id
else:
current_doc_id = doc_id
current_opinion_id = opinion_id

linked.append(self._storage.get_row(row_index))
Expand Down

0 comments on commit 5728d33

Please sign in to comment.