Skip to content

Commit c3dd07c

Browse files
author
Matt Howlett
authored
Merge pull request confluentinc#952 from choogeboom/hoogamaphone_fix_get_compatibility
Make get_compatibility return the actual compatibility level
2 parents 60049a8 + 50dd00e commit c3dd07c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/confluent_kafka/schema_registry/schema_registry_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,8 @@ def get_compatibility(self, subject_name=None):
625625
else:
626626
url = 'config'
627627

628-
return self._rest_client.get(url)
628+
result = self._rest_client.get(url)
629+
return result['compatibilityLevel']
629630

630631

631632
class Schema(object):

tests/integration/schema_registry/test_api_client.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,7 @@ def test_api_subject_config_update(kafka_cluster, load_file):
383383
sr.set_compatibility(subject_name=subject,
384384
level="FULL_TRANSITIVE")
385385

386-
assert sr.get_compatibility(
387-
subject_name=subject)['compatibilityLevel'] == "FULL_TRANSITIVE"
386+
assert sr.get_compatibility(subject_name=subject) == "FULL_TRANSITIVE"
388387

389388

390389
def test_api_config_invalid(kafka_cluster):
@@ -415,7 +414,7 @@ def test_api_config_update(kafka_cluster):
415414

416415
for level in ["BACKWARD", "BACKWARD_TRANSITIVE", "FORWARD", "FORWARD_TRANSITIVE"]:
417416
sr.set_compatibility(level=level)
418-
assert sr.get_compatibility()['compatibilityLevel'] == level
417+
assert sr.get_compatibility() == level
419418

420419

421420
def test_api_register_logical_schema(kafka_cluster, load_file):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy