-
Notifications
You must be signed in to change notification settings - Fork 5
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
Allow users to handle invalid nodes coming from a search against the API #431
Conversation
Merging to
|
except IndexError: # This is not a random access iteration. | ||
# So if fetching a next page wasn't enough to get the index inbound, | ||
# The iteration stops | ||
raise StopIteration | ||
|
||
if self.auto_load_nodes: |
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.
This is the ❤️ of this PR.
while True: | ||
try: | ||
try: | ||
material_node = next(materials_paginator) |
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.
This is using the change in a test.
@@ -97,6 +97,55 @@ the code is written to get a better grasp of it? | |||
There you will find documentation on everything from how our code is structure, | |||
how we aim to write our documentation, CI/CD, and more._ | |||
|
|||
--- | |||
|
|||
**Q:** What can I do, when my `api.search(...)` fails with a `cript.nodes.exception.CRIPTJsonDeserializationError` or similar? |
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.
FAQ to explain to users of how to recover from bad search results.
(Hopefully rarely needed.)
But good to have for debugging anyways.
Description
Before there was no path to recovery if an API search was returning nodes that were deemed incorrect by the SDK.
Now, there is a way to disable auto node conversion.
I think this should only be last resort to recover for advanced users.
But I included an FAQ to explain it to users.
Changes
Known Issues
Notes
Checklist
CONTRIBUTORS.md
) in the pull request source branch.