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

'JsonSourceFile' object has no attribute 'bytes_processed' when using restore #280

Open
brimimc opened this issue Aug 7, 2022 · 1 comment
Labels
bug Something isn't working not qualified The issue is not checked yet by the owners

Comments

@brimimc
Copy link

brimimc commented Aug 7, 2022

Describe the bug
When running a rethinkdb restore and a single document exceeds the max document size, instead of seeing the expected error message you see 'JsonSourceFile' object has no attribute 'bytes_processed'

To Reproduce
Steps to reproduce the behavior:

  1. do a rethinkdb restore that included a document larger than the default max size of 134217728 bytes

Expected behavior
you should see the error message Error: JSON max buffer size exceeded on file %s (from position %d). Use '--max-document-size' to extend your buffer."

Screenshots
If applicable, add screenshots to help explain your problem.

System info

  • OS: [e.g. macOS Mojave 10.14.3]
  • RethinkDB Version: 2.4.1

Additional context
It seems that the bug is that on this line https://github.com/rethinkdb/rethinkdb-python/blob/master/rethinkdb/_import.py#L513 I don't see bytes_processed defined anywhere - not sure if it should be _bytes_read instead

@brimimc brimimc added bug Something isn't working not qualified The issue is not checked yet by the owners labels Aug 7, 2022
@lsabi
Copy link
Contributor

lsabi commented Aug 9, 2022

Thanks for noticing it!

We're currently working on a new version of the driver that will drop support for python 2, allowing us to refactor part of the code and improve the functionality. The bug should be fixed with your suggestion, though at the moment I don't have the means to test it.

I'll keep the issue open and fill a PR for solving this. Once the testing environment is done we'll test it thoughtfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working not qualified The issue is not checked yet by the owners
Projects
None yet
Development

No branches or pull requests

2 participants