Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

Commit

Permalink
increase csv limit in TSVDataSource (#477)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #477

My run faild with _csv.Error: field larger than field limit (131072) error before f107879186

Reviewed By: kartikayk

Differential Revision: D14845916

fbshipit-source-id: 9a059f9c1aa26b58c3f1dd666d94fae199558208
  • Loading branch information
Haoran Li authored and facebook-github-bot committed Apr 15, 2019
1 parent b055fc6 commit 7bf6263
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pytext/data/sources/tsv.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved

import csv
import sys
import threading
from typing import Dict, List, Optional, Type

Expand All @@ -14,6 +15,7 @@ def __init__(self, file, field_names=None, delimiter="\t"):
self.field_names = field_names
self.delimiter = delimiter
self._access_lock = threading.Lock()
csv.field_size_limit(sys.maxsize)

def __iter__(self):
can_acquire = self._access_lock.acquire(blocking=False)
Expand Down

0 comments on commit 7bf6263

Please sign in to comment.