-
Notifications
You must be signed in to change notification settings - Fork 79
Adding schema validation #387
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
Conversation
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.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| data["waitForSync"] = sync | ||
| if schema is not None: | ||
| if not isinstance(schema, dict) or len(schema) == 0: | ||
| raise ValueError("schema parameter must be a non-empty dict") |
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.
Schema removal from collections no longer possible
Medium Severity
The validation rejecting empty dicts removes the previously documented way to clear schema validation from a collection (configure(schema={})). Since schema=None means "don't change," and schema={} now raises ValueError, there's no way for users to remove an existing schema. This is a functional regression with no alternative provided.


This fixes issue #386
Note
Medium Risk
Introduces a small breaking behavior change for callers who previously used
schema={}to clear/disable validation; otherwise changes are localized and low complexity.Overview
Prevents invalid schema validation configs by raising
ValueErrorwhenschemais not a non-emptydictindb.create_collection(..., schema=...)andcollection.configure(schema=...).Updates docs to state empty schemas are not allowed, adjusts collection tests to expect the new exception, makes backup formatting tolerant of missing
Status, adds a short wait after backup restore in tests, and bumps the library version to8.3.0.Written by Cursor Bugbot for commit f2984aa. This will update automatically on new commits. Configure here.