Expose delete organization function #543
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Expose delete organization function
Summary
Exposes the
delete_organizationendpoint through the publicOrganizationResourceinterface. This endpoint was available in the generated OpenAPI client but was not accessible through the public SDK API.Changes
Implementation
delete()method toOrganizationResourceclass inpinecone/admin/resources/organization.pyApiKeyResource.delete()andProjectResource.delete()@require_kwargsdecorator for parameter validationTesting
Added comprehensive unit tests in
tests/unit/admin/test_organization.py:delete()correctly calls the underlying API method with the correctorganization_idparameter@require_kwargsenforces the requiredorganization_idparameterorganization_idvalues to ensure proper parameter passingAll tests use mocks to verify request building without making real API calls.
Usage Example
Backward Compatibility
✅ Fully backward compatible. This is a new method addition that does not modify existing functionality.
Files Changed
pinecone/admin/resources/organization.py- Addeddelete()methodtests/unit/admin/test_organization.py- New file with unit teststests/unit/admin/__init__.py- New file for package structureRelated
This addresses the gap identified in
ENDPOINT_COVERAGE_AUDIT_RESULTS.mdwheredelete_organizationwas marked as missing from the public interface. The endpoint was available inpinecone/core/openapi/admin/api/organizations_api.pybut not exposed throughOrganizationResource.