fix: better error message when docvec is unusable by JohannesMessner · Pull Request #1675 · docarray/docarray · GitHub
Skip to content

fix: better error message when docvec is unusable#1675

Merged
JoanFM merged 3 commits intomainfrom
fix-vec-to-list-error-msg
Jun 27, 2023
Merged

fix: better error message when docvec is unusable#1675
JoanFM merged 3 commits intomainfrom
fix-vec-to-list-error-msg

Conversation

@JohannesMessner
Copy link
Copy Markdown
Member

closes #1563

The approach is to set a flag _is_unasable as soon as the instance gets unusable, and from that point onward raise an Exception at every getatts/setattr interaction.

Unfortunately we cannot override getattr/setattr on the fly (and get rid of the _is_unasable) flag: https://stackoverflow.com/questions/10376604/overriding-special-methods-on-an-instance

Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
@JohannesMessner JohannesMessner requested review from JoanFM and samsja June 27, 2023 15:30
@JohannesMessner JohannesMessner marked this pull request as ready for review June 27, 2023 15:31
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now this is the only cause, actually, but I wanted to keep our options open here.

Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Copy link
Copy Markdown
Member

@JoanFM JoanFM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it unusable?

@github-actions
Copy link
Copy Markdown

📝 Docs are deployed on https://ft-fix-vec-to-list-error-msg--jina-docs.netlify.app 🎉

@JohannesMessner
Copy link
Copy Markdown
Member Author

@JoanFM JoanFM merged commit bcb60ca into main Jun 27, 2023
@JoanFM JoanFM deleted the fix-vec-to-list-error-msg branch June 27, 2023 16:09
@JoanFM JoanFM mentioned this pull request Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: better error message after calling to_doc_list on DocVec

2 participants