Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
isichei committed Jan 11, 2020
1 parent 3f30b3e commit e31135f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions dataengineeringutils3/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ def write_line(self, line):
def file_size_limit_reached(self):

limit_met = sys.getsizeof(self.mem_file) > self.max_bytes
if (not limit_met and self.chunk_size):

if not limit_met and self.chunk_size:
return self.num_lines >= self.chunk_size
else:
return limit_met
Expand Down
7 changes: 2 additions & 5 deletions tests/test_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,10 @@

import jsonlines


@pytest.mark.parametrize(
"max_bytes,chunk_size,expected_num",
[
(1024, None, 5),
(100000000000, 50, 3),
(100000000000, None, 1),
],
[(1024, None, 5), (100000000000, 50, 3), (100000000000, None, 1)],
)
def test_json_split_file_writer(s3, max_bytes, chunk_size, expected_num):
"""Test Writer splits files, gzips and sends to s3"""
Expand Down

0 comments on commit e31135f

Please sign in to comment.