Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
falkerson committed Jul 15, 2019
1 parent f38605f commit 7679fcd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions datarobot_batch_scoring/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
REPORT_INTERVAL,
ProgressQueueMsg)
from datarobot_batch_scoring.detect import Detector
from datarobot_batch_scoring.utils import get_rusage, gzip_with_encoding, SerializableDialect
from datarobot_batch_scoring.utils import (get_rusage,
gzip_with_encoding,
SerializableDialect)


if six.PY2:
Expand Down Expand Up @@ -433,11 +435,12 @@ def sniff_dialect(sample, sep, skip_dialect, ui):


def get_opener_and_mode(is_gz, text=False):
mode = 'rt' if text else 'rb'
if is_gz:
if six.PY2:
mode = 'r' if text else 'rb'
return (gzip_with_encoding, mode)
else:
mode = 'rt' if text else 'rb'
return (gzip.open, mode)
else:
if six.PY2:
Expand All @@ -446,6 +449,7 @@ def get_opener_and_mode(is_gz, text=False):
return (io_open, 'r')
return (open, 'rU')
else:
mode = 'rt' if text else 'rb'
return (open, mode)


Expand Down Expand Up @@ -557,7 +561,6 @@ def auto_sampler(dataset, encoding, ui):

file_lines, csv_lines = 0, 0
dialect = csv.get_dialect('dataset_dialect')
#fd = Recoder(buf, encoding)
reader = csv.reader(buf, dialect=dialect, delimiter=dialect.delimiter)
line_pos = []
for _ in buf:
Expand Down

0 comments on commit 7679fcd

Please sign in to comment.