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

[BUG] Slient invalid document link resolution #872

Open
thorin-schiffer opened this issue Feb 21, 2024 · 1 comment
Open

[BUG] Slient invalid document link resolution #872

thorin-schiffer opened this issue Feb 21, 2024 · 1 comment

Comments

@thorin-schiffer
Copy link

Describe the bug
When a document has a invalid link, fetch_links=True results in a silent non-resolution to the Link object. This is a hardly debuggable case if a collection of objects is fetched.

To Reproduce
So if attribute requires a domain

class Domain(Document):
    ...

class Attribute(Document):
    ...
    domain: Link[Domain]
    ...

and the linked domain was removed, requesting a collection like await Attribute.all(fetch_links=True).to_list() will have both resolved and unresolved links to domain, which is hard to distinguish from await Attribute.all().to_list() without fetched links.

Expected behavior
I would prefer an exception, but alternatively another type can be set, like UnresolvableLink, or None or Link instance with some flag.

@roman-right
Copy link
Member

Hi! Thank you for the issue. I'll think about the interface for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants