Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSV max size OverflowError on Windows #91

Open
soof-golan opened this issue Apr 27, 2022 · 4 comments
Open

CSV max size OverflowError on Windows #91

soof-golan opened this issue Apr 27, 2022 · 4 comments

Comments

@soof-golan
Copy link

I've tried to import redisgraph_bulk_loader.bulk_insert but failed with the following error

File ~\dev\redis-graph-poc\venv\lib\site-packages\redisgraph_bulk_loader\entity_file.py:11, in <module>
      8 from enum import Enum
      9 from exceptions import CSVError, SchemaError
---> 11 csv.field_size_limit(sys.maxsize) # Don't limit the size of user input fields.
     14 class Type(Enum):
     15     UNKNOWN = 0

OverflowError: Python int too large to convert to C long

System:

  • x86_64 Windows 10
  • Python3.9
@chayim
Copy link
Contributor

chayim commented Apr 27, 2022

@soof-golan How many rows is your spreadsheet? Also - how many columns? A ballpark is fine!

@soof-golan
Copy link
Author

Haven't even loaded a CSV, python just fails on import time because of sys.maxsize and the csv module
plan is to ingest approx 200M nodes and approx 2B edges

@hypdeb
Copy link

hypdeb commented Aug 8, 2022

Same issue here. Throws this even without specifying any arguments. Throws the same exception with arguments, even with a modest 12mb file.

@H16C3009
Copy link

【environment】

  • 64-bit operating system, x64-based processor
  • windows 10 home
  • Python3.9.7

【Conclusion】
It worked if I commented out csv.field_size_limit(sys.maxsize) or changed it to csv.field_size_limit(2147483647).

Regarding sys.maxsize,
sys.maxsize = 2**31-1 on Linux in a 32bit environment, so I think it will work.
However, on Windows in a 64bit environment, sys.maxsize = 2**63-1, so it was an OverflowError: Python int too large to convert to C long error.
I felt that the maximum field size that can be newly set in csv.field_size_limit () is 2**31-1 in the current specifications.

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants