Skip to content

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

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

Open
xdgrulez opened this issue Jan 27, 2025 · 1 comment
Open

Comments

@xdgrulez
Copy link

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/python@3.13/3.13.1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/case.py", line 58, in testPartExecutor yield File "/opt/homebrew/Cellar/python@3.13/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/python@3.13/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

@xdgrulez
Copy link
Author

(this is all for 2.8.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants