Skip to content

Commit

Permalink
Remove AvroSerializer from __init__ in root package (#861)
Browse files Browse the repository at this point in the history
  • Loading branch information
rnpridgeon authored May 21, 2020
1 parent 6f122e3 commit 56f1e7a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion confluent_kafka/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
OFFSET_STORED,
OFFSET_INVALID)

__all__ = ['admin', 'AvroSerializer', 'Consumer',
__all__ = ['admin', 'Consumer',
'KafkaError', 'KafkaException',
'kafkatest', 'libversion', 'Message',
'OFFSET_BEGINNING', 'OFFSET_END', 'OFFSET_INVALID', 'OFFSET_STORED',
Expand Down
13 changes: 13 additions & 0 deletions tests/integration/schema_registry/data/logical_date.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "a_schema",
"type": "record",
"fields": [
{
"name": "date_field",
"type": {
"type": "int",
"logicalType": "date"
}
}
]
}
13 changes: 13 additions & 0 deletions tests/integration/schema_registry/test_api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,3 +416,16 @@ def test_api_config_update(kafka_cluster):
for level in ["BACKWARD", "BACKWARD_TRANSITIVE", "FORWARD", "FORWARD_TRANSITIVE"]:
sr.set_compatibility(level=level)
assert sr.get_compatibility()['compatibilityLevel'] == level


def test_api_register_logical_schema(kafka_cluster, load_file):
sr = kafka_cluster.schema_registry()

schema = Schema(load_file('logical_date.avsc'), schema_type='AVRO')
subject = _subject_name('test_logical_registration')

schema_id = sr.register_schema(subject, schema)
registered_schema = sr.lookup_schema(subject, schema)

assert registered_schema.schema_id == schema_id
assert registered_schema.subject == subject

0 comments on commit 56f1e7a

Please sign in to comment.