-
Notifications
You must be signed in to change notification settings - Fork 6
Add delete_detector method to Groundlight SDK #370
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
- Implement delete_detector() method in client.py that accepts both Detector objects and ID strings - Add comprehensive integration test covering deletion by object, by ID, and error handling - Follow existing SDK patterns for parameter handling and error conversion - Include proper documentation with usage examples and warnings about irreversible deletion 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
| """ | ||
| # Create a detector to delete | ||
| name = f"Test delete detector {datetime.utcnow()}" | ||
| query = "Is there a dog to delete?" |
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 name is so sad
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.
bad claude
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.
I was going to change it originally, but then I thought about the silly test strings I've used and figured I'd let Claude have its fun
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.
I'm going to assume that Claude was being funny here, and not just confused.
test/integration/test_groundlight.py
Outdated
|
|
||
| # Verify the detector exists | ||
| retrieved_detector = gl.get_detector(detector.id) | ||
| assert retrieved_detector.id == detector.id |
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 assert is not meaningful? remove?
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.
Sure. Interestingly, this line is added because it's an exact pattern match of the structure of the get_detector methods.
| assert retrieved_detector.id == detector.id |
| detector_id = str(detector) | ||
|
|
||
| try: | ||
| self.detectors_api.delete_detector(id=detector_id, _request_timeout=DEFAULT_REQUEST_TIMEOUT) |
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.
I have no idea if this line is correct. I assume you've already verified that it is?
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.
It is correct. It's a pretty strict pattern match from the create_detector method
|
Do we want to add a test that an IQ and label submitted to detector is also deleted? Or is that tested elsewhere? |
…thon-sdk into implement_delete_detector
🤖 Generated with Claude Code