Commit 7a4fa20
authored
Expose delete organization function (#543)
# Expose delete organization function
## Summary
Exposes the `delete_organization` endpoint through the public
`OrganizationResource` interface. This endpoint was available in the
generated OpenAPI client but was not accessible through the public SDK
API.
## Changes
### Implementation
- Added `delete()` method to `OrganizationResource` class in
`pinecone/admin/resources/organization.py`
- Method follows the same pattern as `ApiKeyResource.delete()` and
`ProjectResource.delete()`
- Includes `@require_kwargs` decorator for parameter validation
- Added RST-formatted docstring with warning about permanent deletion
- Updated class docstring to mention delete functionality
### Testing
Added comprehensive unit tests in
`tests/unit/admin/test_organization.py`:
- **Request verification**: Tests verify that `delete()` correctly calls
the underlying API method with the correct `organization_id` parameter
- **Parameter validation**: Tests verify that `@require_kwargs` enforces
the required `organization_id` parameter
- **Edge cases**: Tests with different `organization_id` values to
ensure proper parameter passing
All tests use mocks to verify request building without making real API
calls.
## Usage Example
```python
from pinecone import Admin
admin = Admin()
# Delete an organization
admin.organization.delete(
organization_id="42ca341d-43bf-47cb-9f27-e645dbfabea6"
)
```
## Backward Compatibility
✅ Fully backward compatible. This is a new method addition that does not
modify existing functionality.
## Files Changed
- `pinecone/admin/resources/organization.py` - Added `delete()` method
- `tests/unit/admin/test_organization.py` - New file with unit tests
- `tests/unit/admin/__init__.py` - New file for package structure
## Related
This addresses the gap identified in
`ENDPOINT_COVERAGE_AUDIT_RESULTS.md` where `delete_organization` was
marked as missing from the public interface. The endpoint was available
in `pinecone/core/openapi/admin/api/organizations_api.py` but not
exposed through `OrganizationResource`.1 parent b1f3151 commit 7a4fa20
File tree
3 files changed
+91
-1
lines changed- pinecone/admin/resources
- tests/unit/admin
3 files changed
+91
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
0 commit comments