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

[BUGFix] deepcopy IO.BufferedRandom error #828

Merged
merged 2 commits into from
May 24, 2024

Conversation

dedalo944
Copy link
Contributor

Description

Fix UploadFile format type to use deepcopy() method

Related to issue #(808)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

@pieroit
Copy link
Member

pieroit commented May 19, 2024

Hi @dedalo944 thanks

Why deepcopy is still there?
Isn't is easier to just save the file in /tmp/xxx and delete it after it is ingested by the rabbit hole?

@dedalo944
Copy link
Contributor Author

Hi @dedalo944 thanks

Why deepcopy is still there? Isn't is easier to just save the file in /tmp/xxx and delete it after it is ingested by the rabbit hole?

Tbh i thought you want to use deepcopy, its way slower but more secure if someone change the document when you drag and drop a file into the Cat... so, you tell me what you prefer

@pieroit
Copy link
Member

pieroit commented May 19, 2024

Hi @dedalo944 thanks
Why deepcopy is still there? Isn't is easier to just save the file in /tmp/xxx and delete it after it is ingested by the rabbit hole?

Tbh i thought you want to use deepcopy, its way slower but more secure if someone change the document when you drag and drop a file into the Cat... so, you tell me what you prefer

I propose to save the file in /tmp, deepcopy or not, and then delete it when ingestion is finished :)
This should avoid the buffer error for big files (hopefully)

Thanks

@dedalo944
Copy link
Contributor Author

Hi @dedalo944 thanks
Why deepcopy is still there? Isn't is easier to just save the file in /tmp/xxx and delete it after it is ingested by the rabbit hole?

Tbh i thought you want to use deepcopy, its way slower but more secure if someone change the document when you drag and drop a file into the Cat... so, you tell me what you prefer

I propose to save the file in /tmp, deepcopy or not, and then delete it when ingestion is finished :) This should avoid the buffer error for big files (hopefully)

Thanks

Hmm, ok. I'll try to do that next days.
Btw changing the byte stream into io.BytesIO resolve the Buffer error (or at least with the same file i had the error)

@pieroit
Copy link
Member

pieroit commented May 19, 2024

Hi @dedalo944 thanks
Why deepcopy is still there? Isn't is easier to just save the file in /tmp/xxx and delete it after it is ingested by the rabbit hole?

Tbh i thought you want to use deepcopy, its way slower but more secure if someone change the document when you drag and drop a file into the Cat... so, you tell me what you prefer

I propose to save the file in /tmp, deepcopy or not, and then delete it when ingestion is finished :) This should avoid the buffer error for big files (hopefully)
Thanks

Hmm, ok. I'll try to do that next days. Btw changing the byte stream into io.BytesIO resolve the Buffer error (or at least with the same file i had the error)

Ok then, please leave as is ;)
I'll merge

@pieroit pieroit merged commit 1c62993 into cheshire-cat-ai:develop May 24, 2024
1 check failed
@pieroit
Copy link
Member

pieroit commented May 24, 2024

Thanks @dedalo944 !
Let's keep an eye on this in case needs adjustments

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

Successfully merging this pull request may close these issues.

None yet

2 participants