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

Add a fallback on annotation validation #531

Merged
merged 2 commits into from
Sep 29, 2024

Conversation

kbolashev
Copy link
Member

Having a malformed annotation on a datapoint (or an annotation that failed to parse, not even malformed) right now leads to the whole loading process failing.

This PR is a hotfix to prevent that.
If an annotation fails to parse, it gets shown to the user in a warning message, and I warn them that they won't be able to interact with them, for example:

Accessing as kirill
Downloading annotation fields ['annotation']...
Warning: The following datapoints had invalid annotations, any annotation-related operations will not work on these:
Field "annotation" in datapoints:
        train2017/000000000009.jpg

I'm not handling these bad annotations in other downstream functions for now properly, if we do want to make it have a nice UX, would probably need to have some kind of BrokenAnnotation class that will shim the regular annotation functions and display a warning.
Not sure if it's worth it to work on this right now

@kbolashev kbolashev added the bug Something isn't working label Sep 25, 2024
@kbolashev kbolashev self-assigned this Sep 25, 2024
Copy link

dagshub bot commented Sep 25, 2024

Copy link
Contributor

@EvgeniLeonti EvgeniLeonti left a comment

Choose a reason for hiding this comment

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

LGTM

Make sure formatting is ok:

dagshub/data_engine/model/query_result.py#L446
Too many blank lines (2) (E303)

@kbolashev
Copy link
Member Author

Good catch, I think my autoformatter broke 🥲

@kbolashev kbolashev merged commit 4ac1e4d into master Sep 29, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants