Skip to content

SR API coverage still not quite complete when it comes to soft/hard delete #1912

Open
@xdgrulez

Description

@xdgrulez

Hi,

there are still two more issues wrt SR API coverage when it comes to soft/hard delete.

  1. get_subjects()
    Does not support the boolean "deleted" parameter. In the SR API, you can get a combined list of non-deleted subjects and soft-deleted ones by adding "?deleted=True". This is not yet supported in the Python wrapper.

  2. delete_versions()
    It does support the parameter boolean "permanent", but there seems to be a bug in the internal caching. When I first delete a schema version (soft) and then try to trigger a hard-delete, I end up with:

Traceback (most recent call last): File "/opt/homebrew/Cellar/[email protected]/3.13.1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/case.py", line 58, in testPartExecutor yield File "/opt/homebrew/Cellar/[email protected]/3.13.1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/case.py", line 651, in run self._callTestMethod(testMethod) ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^ File "/opt/homebrew/Cellar/[email protected]/3.13.1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/case.py", line 606, in _callTestMethod if method() is not None: ~~~~~~^^ File "/Users/m0724822/kafka/kafi/test/test_single_storage_base.py", line 1278, in test_sr_two_versions version_int = s.delete_version(key_subject_name_str, 1, permanent=True) File "/Users/m0724822/kafka/kafi/kafi/schemaregistry.py", line 151, in delete_version schema_id_int = self.schemaRegistryClient.delete_version(subject_name_str, version_int, permanent=permanent_bool) File "/Users/m0724822/kafka/kafi/venv/lib/python3.13/site-packages/confluent_kafka/schema_registry/schema_registry_client.py", line 976, in delete_version self._cache.remove_by_subject_version(subject_name, version) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/m0724822/kafka/kafi/venv/lib/python3.13/site-packages/confluent_kafka/schema_registry/schema_registry_client.py", line 509, in remove_by_subject_version del self.rs_schema_index[subject][schema_id] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^ KeyError: 5

Metadata

Metadata

Assignees

No one assigned

    Labels

    component:schema-registryAny schema registry related isues rather than kafka isolated ones

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions