Skip to content

Conversation

@jhamon
Copy link
Collaborator

@jhamon jhamon commented Nov 15, 2025

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

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.

@jhamon jhamon marked this pull request as ready for review November 15, 2025 21:23
@jhamon jhamon merged commit 7a4fa20 into release-candidate/2025-10 Nov 15, 2025
26 of 27 checks passed
@jhamon jhamon deleted the jhamon/delete-org branch November 15, 2025 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants