GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: better error message when docvec is unusable by JohannesMessner · Pull Request #1675 · docarray/docarray

This repository was archived by the owner on Sep 9, 2026. It is now read-only.

Conversation

@JohannesMessner

@JohannesMessner JohannesMessner commented Jun 27, 2023

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@JohannesMessner
fix: better error message when docvec is unusable
d4bedf3
Signed-off-by: Johannes Messner <[email protected]>
@github-actions github-actions Bot added size/s area/core component/array labels Jun 27, 2023
@JohannesMessner
test: add test
c104731
Signed-off-by: Johannes Messner <[email protected]>
@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
@github-actions github-actions Bot added the area/testing label Jun 27, 2023
JohannesMessner
JohannesMessner commented Jun 27, 2023
View reviewed changes
Comment thread docarray/array/any_array.py

UNUSABLE_ERROR_MSG = (
'This {cls} instance is in an unusable state. \n'
'The most common cause of this is converting a DocVec to a DocList. '

@JohannesMessner JohannesMessner Jun 27, 2023

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@JohannesMessner
fix: add more context to error msg
7a05872
Signed-off-by: Johannes Messner <[email protected]>
JoanFM
JoanFM suggested changes Jun 27, 2023
View reviewed changes

@JoanFM JoanFM left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this 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?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@github-actions

github-actions Bot commented Jun 27, 2023

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@JohannesMessner

JohannesMessner commented Jun 27, 2023

Copy link
Copy Markdown
Member Author

Why is it unusable?

Because to_doc_list() directly modifies the data stored in the columns in order to not copy the data. This "destroys" the columns.
@samsja knows more about the implementation details.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

JoanFM
JoanFM approved these changes Jun 27, 2023
View reviewed changes
@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
Release Notes v0.35.0 #1683
Closed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@samsja samsja Awaiting requested review from samsja
1 more reviewer
@JoanFM JoanFM JoanFM approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

area/core area/testing component/array size/s

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

bug: better error message after calling to_doc_list on DocVec

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@JohannesMessner @JoanFM
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.