Skip to content

Fix for issue #443. #444

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions confluent_kafka/avro/cached_schema_registry_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def update_compatibility(self, level, subject=None):
if code >= 200 and code <= 299:
return result['compatibility']
else:
raise ClientError("Unable to update level: %s. Error code: %d" % (str(level)), code)
raise ClientError("Unable to update level: %s. Error code: %d" % (str(level), code))

def get_compatibility(self, subject=None):
"""
Expand All @@ -323,7 +323,7 @@ def get_compatibility(self, subject=None):
if not is_successful_request:
raise ClientError('Unable to fetch compatibility level. Error code: %d' % code)

compatibility = result.get('compatibility', None)
compatibility = result.get('compatibilityLevel', None)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@rnpridgeon rnpridgeon Sep 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have opened a docs jira for this. This absolutely the case I ran into the same issue implementing the SR client in golang.

see DOCS-762 @edenhill

I had to handle it as follows:

/* NOTE: GET uses compatibilityLevel, POST uses compatibility */
type compatibilityLevel struct {
	CompatibilityUpdate Compatibility `json:"compatibility,omitempty"`
	Compatibility       Compatibility `json:"compatibilityLevel,omitempty"`
}

if compatibility not in VALID_LEVELS:
if compatibility is None:
error_msg_suffix = 'No compatibility was returned'
Expand Down