[DTX-871] Refactor for async support#1971
Merged
Rohit Sanjay (rohitsanj) merged 15 commits intomasterfrom May 30, 2025
Merged
Conversation
|
🎉 All Contributor License Agreements have been signed. Ready to merge. |
…support src/confluent_kafka/schema_registry/avro.py (change applied to src/confluent_kafka/schema_registry/_sync/avro.py)
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Comment on lines
-80
to
+81
| with (patch("confluent_kafka.schema_registry.schema_registry_client.time.sleep") as mock_sleep, | ||
| patch("confluent_kafka.schema_registry.schema_registry_client.full_jitter") as mock_jitter): | ||
| with (patch("confluent_kafka.schema_registry._sync.schema_registry_client.time.sleep") as mock_sleep, | ||
| patch("confluent_kafka.schema_registry._sync.schema_registry_client.full_jitter") as mock_jitter): |
Contributor
Author
There was a problem hiding this comment.
unittest.mock.patch needs to be used directly with the module that defines the function to be patched, hence this change.
2 tasks
| import os | ||
| from setuptools import setup | ||
| from distutils.core import Extension | ||
| from setuptools import Extension |
Contributor
Author
There was a problem hiding this comment.
This is required to pip install . on Python 11+
This comment has been minimized.
This comment has been minimized.
3 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Robert Yokota (rayokota)
approved these changes
May 30, 2025
Member
Robert Yokota (rayokota)
left a comment
There was a problem hiding this comment.
Thanks Rohit Sanjay (@rohitsanj) , LGTM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
This PR refactors the schema registry modules across a newly introduced
_syncpackage, as well as thecommonpackage. The PR that introduces the_asyncpackage is stacked onto this one, see #1965.To illustrate the changes made, let's take
src/confluent_kafka/schema_registry/schema_registry_client.pyfor example:src/confluent_kafka/schema_registry/common/schema_registry_client.py-- this package is intended to house functionality that is common to both the sync and async implementations.SchemaRegistryClientand its dependent classes were moved intosrc/confluent_kafka/schema_registry/_sync/schema_registry_client.pysrc/schema_registry/schema_registry_client.pywas refactored to only contain imports from thecommon.schema_registry_clientand_sync.schema_registry_clientmodules. This is done so that users relying on imports directly fromconfluent_kafka.schema_registry.schema_registry_clientdon't encounter any breaking/missing imports.The above treatment was applied to:
schema_registry_client.py(as demonstrated),avro.py,json_schema.py,protobuf.pyandserde.py.Other changes:
_sync(with minimal changes).Checklist
References
JIRA:
Test & Review
Open questions / Follow-ups