Skip to content

Commit

Permalink
Use ArrowWriter as context manager in metric
Browse files Browse the repository at this point in the history
  • Loading branch information
albertvillanova committed Mar 2, 2021
1 parent e00d72a commit 7f287fb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/datasets/metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,8 @@ def _finalize(self):
from all the nodes if main node or all_process is True.
"""
if self.writer is not None:
self.writer.finalize()
with self.writer as writer:
writer.finalize()
self.writer = None
if self.filelock is not None:
self.filelock.release()
Expand Down

0 comments on commit 7f287fb

Please sign in to comment.