Skip to content

Commit

Permalink
Account for soft-deleted subjects (confluentinc#1127)
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickTu committed May 25, 2021
1 parent e1c3227 commit e3df0b9
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/confluent_kafka/schema_registry/schema_registry_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,12 +458,16 @@ def delete_subject(self, subject_name, permanent=False):
`DELETE Subject API Reference <https://docs.confluent.io/current/schema-registry/develop/api.html#delete--subjects-(string-%20subject)>`_
""" # noqa: E501
list = self._rest_client.delete('subjects/{}'
.format(_urlencode(subject_name)))
try:
list = self._rest_client.delete('subjects/{}'
.format(_urlencode(subject_name)))
except SchemaRegistryError as e:
if e.error_code != 40404:
raise

if permanent:
self._rest_client.delete('subjects/{}?permanent=true'
.format(_urlencode(subject_name)))
list = self._rest_client.delete('subjects/{}?permanent=true'
.format(_urlencode(subject_name)))

return list

Expand Down

0 comments on commit e3df0b9

Please # to comment.