From 654c7beef1b2a2897ec0d4c7b251e8324bfb1dd2 Mon Sep 17 00:00:00 2001 From: Pranav Rathi <4427674+pranavrth@users.noreply.github.com> Date: Fri, 10 Oct 2025 04:56:01 +0530 Subject: [PATCH 1/4] Treat warnings as error in doc generation --- docs/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Makefile b/docs/Makefile index 58a5b2af3..0d7d22d16 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -2,7 +2,7 @@ # # You can set these variables from the command line. -SPHINXOPTS = +SPHINXOPTS = -W SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build From 6975543b3b8bc6719d767036b34c678e2bb6c78b Mon Sep 17 00:00:00 2001 From: Pranav Rathi <4427674+pranavrth@users.noreply.github.com> Date: Mon, 13 Oct 2025 19:30:02 +0530 Subject: [PATCH 2/4] Fix doc generation issues --- docs/conf.py | 2 +- src/confluent_kafka/__init__.py | 2 ++ src/confluent_kafka/schema_registry/_async/avro.py | 1 + src/confluent_kafka/schema_registry/_async/json_schema.py | 7 +++---- src/confluent_kafka/schema_registry/_async/protobuf.py | 3 ++- .../schema_registry/_async/schema_registry_client.py | 8 ++++---- src/confluent_kafka/schema_registry/_sync/avro.py | 1 + src/confluent_kafka/schema_registry/_sync/json_schema.py | 7 +++---- src/confluent_kafka/schema_registry/_sync/protobuf.py | 3 ++- .../schema_registry/_sync/schema_registry_client.py | 8 ++++---- 10 files changed, 23 insertions(+), 19 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 444a1e2ea..9eb3ce470 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -133,7 +133,7 @@ def _read_version_from_pyproject(pyproject_path=None): # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] +# html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] # Add any paths that contain custom themes here, relative to this directory. # html_theme_path = [] diff --git a/src/confluent_kafka/__init__.py b/src/confluent_kafka/__init__.py index 48296d346..05436962d 100644 --- a/src/confluent_kafka/__init__.py +++ b/src/confluent_kafka/__init__.py @@ -27,6 +27,7 @@ TopicCollection, TopicPartitionInfo, IsolationLevel, + ElectionType ) import os from .cimpl import ( @@ -74,6 +75,7 @@ "IsolationLevel", "TopicCollection", "TopicPartitionInfo", + "ElectionType" ] diff --git a/src/confluent_kafka/schema_registry/_async/avro.py b/src/confluent_kafka/schema_registry/_async/avro.py index 09bbe5ac0..ce2470fa3 100644 --- a/src/confluent_kafka/schema_registry/_async/avro.py +++ b/src/confluent_kafka/schema_registry/_async/avro.py @@ -407,6 +407,7 @@ class AsyncAvroDeserializer(AsyncBaseDeserializer): | ``schema.id.deserializer`` | callable | Defines how the schema id/guid is deserialized. | | | | Defaults to dual_schema_id_deserializer. | +-----------------------------+----------+--------------------------------------------------+ + Note: By default, Avro complex types are returned as dicts. This behavior can be overridden by registering a callable ``from_dict`` with the deserializer to diff --git a/src/confluent_kafka/schema_registry/_async/json_schema.py b/src/confluent_kafka/schema_registry/_async/json_schema.py index 2fbdbcccc..e465df083 100644 --- a/src/confluent_kafka/schema_registry/_async/json_schema.py +++ b/src/confluent_kafka/schema_registry/_async/json_schema.py @@ -98,10 +98,9 @@ class AsyncJSONSerializer(AsyncBaseSerializer): | ``normalize.schemas`` | bool | transform schemas to have a consistent format, | | | | including ordering properties and references. | +-----------------------------+----------+----------------------------------------------------+ - | | | Whether to use the given schema ID for | - | ``use.schema.id`` | int | serialization. | - | | | | - +-----------------------------+----------+--------------------------------------------------+ + | | | Whether to use the given schema ID for | + | ``use.schema.id`` | int | serialization. | + +-----------------------------+----------+----------------------------------------------------+ | | | Whether to use the latest subject version for | | ``use.latest.version`` | bool | serialization. | | | | | diff --git a/src/confluent_kafka/schema_registry/_async/protobuf.py b/src/confluent_kafka/schema_registry/_async/protobuf.py index f7d1dc8b3..e0ea299fa 100644 --- a/src/confluent_kafka/schema_registry/_async/protobuf.py +++ b/src/confluent_kafka/schema_registry/_async/protobuf.py @@ -57,6 +57,7 @@ async def _resolve_named_schema( ): """ Resolves named schemas referenced by the provided schema recursively. + :param schema: Schema to resolve named schemas for. :param schema_registry_client: AsyncSchemaRegistryClient to use for retrieval. :param pool: DescriptorPool to add resolved schemas to. @@ -104,7 +105,7 @@ class AsyncProtobufSerializer(AsyncBaseSerializer): | | | Whether to use the given schema ID for | | ``use.schema.id`` | int | serialization. | | | | | - +-----------------------------------------+----------+--------------------------------------------------+ + +-------------------------------------+----------+------------------------------------------------------+ | | | Whether to use the latest subject version for | | ``use.latest.version`` | bool | serialization. | | | | | diff --git a/src/confluent_kafka/schema_registry/_async/schema_registry_client.py b/src/confluent_kafka/schema_registry/_async/schema_registry_client.py index e8458aeed..c159783a3 100644 --- a/src/confluent_kafka/schema_registry/_async/schema_registry_client.py +++ b/src/confluent_kafka/schema_registry/_async/schema_registry_client.py @@ -634,7 +634,7 @@ async def register_schema( Compatibility policy or is otherwise invalid. See Also: - `POST Subject API Reference `_ + `POST Subject Version API Reference `_ """ # noqa: E501 registered_schema = await self.register_schema_full_response(subject_name, schema, normalize_schemas) @@ -660,7 +660,7 @@ async def register_schema_full_response( Compatibility policy or is otherwise invalid. See Also: - `POST Subject API Reference `_ + `POST Subject Version API Reference `_ """ # noqa: E501 schema_id = self._cache.get_id_by_schema(subject_name, schema) @@ -1114,7 +1114,7 @@ async def get_referenced_by( SchemaRegistryError: if the schema version can't be found or referenced schemas can't be retrieved See Also: - `GET Subject Versions API Reference `_ + `GET Subject Versions (ReferenceBy) API Reference `_ """ # noqa: E501 query = {'offset': offset, 'limit': limit} @@ -1142,7 +1142,7 @@ async def get_versions( SchemaRegistryError: If subject can't be found See Also: - `GET Subject Versions API Reference `_ + `GET Subject All Versions API Reference `_ """ # noqa: E501 query = {'deleted': deleted, 'deleted_only': deleted_only, 'offset': offset, 'limit': limit} diff --git a/src/confluent_kafka/schema_registry/_sync/avro.py b/src/confluent_kafka/schema_registry/_sync/avro.py index 571b6a6f4..8ffdc370e 100644 --- a/src/confluent_kafka/schema_registry/_sync/avro.py +++ b/src/confluent_kafka/schema_registry/_sync/avro.py @@ -407,6 +407,7 @@ class AvroDeserializer(BaseDeserializer): | ``schema.id.deserializer`` | callable | Defines how the schema id/guid is deserialized. | | | | Defaults to dual_schema_id_deserializer. | +-----------------------------+----------+--------------------------------------------------+ + Note: By default, Avro complex types are returned as dicts. This behavior can be overridden by registering a callable ``from_dict`` with the deserializer to diff --git a/src/confluent_kafka/schema_registry/_sync/json_schema.py b/src/confluent_kafka/schema_registry/_sync/json_schema.py index 116ed87d1..e17d70715 100644 --- a/src/confluent_kafka/schema_registry/_sync/json_schema.py +++ b/src/confluent_kafka/schema_registry/_sync/json_schema.py @@ -98,10 +98,9 @@ class JSONSerializer(BaseSerializer): | ``normalize.schemas`` | bool | transform schemas to have a consistent format, | | | | including ordering properties and references. | +-----------------------------+----------+----------------------------------------------------+ - | | | Whether to use the given schema ID for | - | ``use.schema.id`` | int | serialization. | - | | | | - +-----------------------------+----------+--------------------------------------------------+ + | | | Whether to use the given schema ID for | + | ``use.schema.id`` | int | serialization. | + +-----------------------------+----------+----------------------------------------------------+ | | | Whether to use the latest subject version for | | ``use.latest.version`` | bool | serialization. | | | | | diff --git a/src/confluent_kafka/schema_registry/_sync/protobuf.py b/src/confluent_kafka/schema_registry/_sync/protobuf.py index f202f0e99..eed8442b9 100644 --- a/src/confluent_kafka/schema_registry/_sync/protobuf.py +++ b/src/confluent_kafka/schema_registry/_sync/protobuf.py @@ -57,6 +57,7 @@ def _resolve_named_schema( ): """ Resolves named schemas referenced by the provided schema recursively. + :param schema: Schema to resolve named schemas for. :param schema_registry_client: SchemaRegistryClient to use for retrieval. :param pool: DescriptorPool to add resolved schemas to. @@ -104,7 +105,7 @@ class ProtobufSerializer(BaseSerializer): | | | Whether to use the given schema ID for | | ``use.schema.id`` | int | serialization. | | | | | - +-----------------------------------------+----------+--------------------------------------------------+ + +-------------------------------------+----------+------------------------------------------------------+ | | | Whether to use the latest subject version for | | ``use.latest.version`` | bool | serialization. | | | | | diff --git a/src/confluent_kafka/schema_registry/_sync/schema_registry_client.py b/src/confluent_kafka/schema_registry/_sync/schema_registry_client.py index 02c38318a..747d8ab82 100644 --- a/src/confluent_kafka/schema_registry/_sync/schema_registry_client.py +++ b/src/confluent_kafka/schema_registry/_sync/schema_registry_client.py @@ -634,7 +634,7 @@ def register_schema( Compatibility policy or is otherwise invalid. See Also: - `POST Subject API Reference `_ + `POST Subject Version API Reference `_ """ # noqa: E501 registered_schema = self.register_schema_full_response(subject_name, schema, normalize_schemas) @@ -660,7 +660,7 @@ def register_schema_full_response( Compatibility policy or is otherwise invalid. See Also: - `POST Subject API Reference `_ + `POST Subject Version API Reference `_ """ # noqa: E501 schema_id = self._cache.get_id_by_schema(subject_name, schema) @@ -1114,7 +1114,7 @@ def get_referenced_by( SchemaRegistryError: if the schema version can't be found or referenced schemas can't be retrieved See Also: - `GET Subject Versions API Reference `_ + `GET Subject Versions (ReferenceBy) API Reference `_ """ # noqa: E501 query = {'offset': offset, 'limit': limit} @@ -1142,7 +1142,7 @@ def get_versions( SchemaRegistryError: If subject can't be found See Also: - `GET Subject Versions API Reference `_ + `GET Subject All Versions API Reference `_ """ # noqa: E501 query = {'deleted': deleted, 'deleted_only': deleted_only, 'offset': offset, 'limit': limit} From 1835a4b6b1ec5a7e22c0693b7e6667422ad285fc Mon Sep 17 00:00:00 2001 From: Pranav Rathi <4427674+pranavrth@users.noreply.github.com> Date: Mon, 13 Oct 2025 19:35:50 +0530 Subject: [PATCH 3/4] flake8 fixes --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 9eb3ce470..4585b0b94 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -12,7 +12,7 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sphinx_rtd_theme +# import sphinx_rtd_theme import os try: import tomllib From ee83ddd37833b96b0f783f24b51b49cbf60bbf4b Mon Sep 17 00:00:00 2001 From: Pranav Rathi <4427674+pranavrth@users.noreply.github.com> Date: Tue, 14 Oct 2025 13:28:58 +0530 Subject: [PATCH 4/4] Removed sphinx_rtd_theme from docs conf file --- docs/conf.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 4585b0b94..8b2701fd1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -12,7 +12,6 @@ # All configuration values have a default; values that are commented out # serve to show the default. -# import sphinx_rtd_theme import os try: import tomllib @@ -133,7 +132,6 @@ def _read_version_from_pyproject(pyproject_path=None): # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -# html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] # Add any paths that contain custom themes here, relative to this directory. # html_theme_path = []