chore(deps): update dependency kafka-python to v3#14312
Open
renovate-bot wants to merge 1 commit into
Open
Conversation
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.
This PR contains the following updates:
==2.0.6→==3.0.0Release Notes
dpkp/kafka-python (kafka-python)
v3.0.0Compare Source
This is a major release with significant changes to kafka-python internals to simplify networking and feature development. It introduces a new networking layer (
kafka.net) and a dynamic protocol system that uses JSON schema files imported from Apache Kafka. It substantially refactors and expands the Admin client, including breaking changes to some API signatures, and it lands a long list of KIP features/changes across the producer, consumer, admin, and networking/metadata clients. Protocol support across kafka-python is now at or beyond the apache kafka 3.0 baseline.Breaking Changes
Python Compatibility
Default Configuration Changes
Abstract Interface Changes
Admin API Changes
Consumer API Changes
Error Hierarchy
Old Networking Stack Removal
SASL Module Rename
Networking (kafka.net)
Complete refactor of the networking layer using a bespoke event-loop supporting async/await (but no asyncio yet). All three clients (Admin, Consumer, Producer) use a dedicated IO thread that drives a selector-based event loop. AdminClient/KafkaConsumer leverage a built-in io thread supplied by kafka.net, KafkaProducer continues to use its existing background Sender thread for now.
Async IO Substrate
Transports and Proxies
SASL Authentication
Timeouts and Connection Management
Per-request and per-stage timeouts replace the old single client-wide timeout.
Futures and Wakeups
The
Futureprimitive gains__await__and a faster slotted implementation; cross-thread wakeups are factored out into a reusable helper.Concurrency and Error Handling
Defensive checks throughout the kafka.net event loop and transport stack: improved socket I/O error handling, RuntimeErrors on misuse of the IO thread, and lock-based detection of concurrent access.
_poll_once; add net.drain() (#2949)Protocol
A new JSON-schema-based dynamic protocol generator now replaces the legacy hand-written protocol classes (moved to
kafka.protocol.old).Dynamic Protocol Classes
Protocol classes are now generated from the upstream Apache Kafka JSON schemas.
New Types and Messages
Performance
Protocol Fixes
Helpers and Debugging
Broker Version Check
Broker version inference is consolidated into a single
BrokerVersionDatahelper that tracks the broker's reported API versions and infers a broker version string.ApiVersionsRequestis always sent on connect.BrokerVersionData
ApiVersionsRequest
Client Bootstrap
Consumer
KafkaConsumer drops the dedicated HeartbeatThread in favor of scheduled async tasks on the kafka.net IO thread. Internals have been substantially refactored to migrate from future callbacks to async/await syntax. Feature support added for incremental cooperative rebalancing (KIP-429), rack-aware fetch (KIP-392), and log truncation detection (KIP-320/KIP-595).
Threading and IO
All consumer network I/O now flows through the shared kafka.net IO thread;
consumer.poll()no longer drives the event loop directly._update_fetch_positions->_refresh_committed_offsets; dont poll in position() (#2958)Group Membership and Rebalance
Fetch
Offsets and Commits
Configuration
Consumer Fixes
Fetcher._fetch_offsets_by_timesretry handling (#2833)Producer
KafkaProducer gains a sticky partitioner (KIP-480), enabled-by-default idempotence (KIP-679), tightened transaction handling, and a faster send/encode path.
Transactions and Idempotence
Partitioning
Batching and Send Path
Split-and-resend oversized batches instead of failing; avoid redundant validation and buffer copies on hot send-path.
Producer Fixes
Admin Client
Split KafkaAdminClient into focused mixin classes (cluster, topics, configs, groups, ACLs, log dirs, etc), and convert request-sending path to async def methods that run on the kafka.net IO thread. Support for new KIPs using new protocol stack.
Refactor and Async Migration
The admin client interface remains sync but wraps a fully-async internal api (does not support asyncio yet). Adds cached coordinator lookups and a mixin structure to separate logical resource groups.
_send_request_to_controllererror handling (#2751)Batch Protocol Support
New Cluster and Quorum APIs
Configs
Topics and Partitions
Groups
Transactions
Log Dirs
Reliability
CLI
The CLI adds shared parser config, SASL/SSL connection support across all subcommands, and several new admin subcommands (acls, configs alter, users).
Common Infrastructure
Admin CLI
Consumer CLI
Compatibility / Misc
Small quality-of-life additions to the public API surface.
Fixes
Codec and Python-3-compatibility fixes that aren't specific to a single client.
Tests
A new in-memory
MockBroker/MockTransportenables deterministic protocol-level tests, and the integration test fixtures have been substantially consolidated.MockBroker and Fixtures
Reliability
Project Infra
v2.3.2Compare Source
2.3.2 (Jun 3, 2026)
Fixes
_callbacks/_errbackslist when futureis_doneto avoid reference cycles (#2891)v2.3.1Compare Source
Fixes
Fetcher._fetch_offsets_by_timesretry handling (#2833)v2.3.0Compare Source
CLI
Producer
Consumer
AdminClient
send_request()andsend_requests()to KafkaAdminClient (#2649)Maintenance
Project Infra
v2.2.20Compare Source
2.2.20 (Jun 3, 2026)
Fixes
_callbacks/_errbackslist when futureis_doneto avoid reference cycles (#2891)v2.2.19Compare Source
Fixes
Fetcher._fetch_offsets_by_times retry handling(#2833)v2.2.18Compare Source
Fixes
v2.2.17Compare Source
Fixes
Networking
Documentation
transactional_idto KafkaProducer Keyword Arguments docstringv2.2.16Compare Source
Fixes
Consumer.position()(k61n / #2668)v2.2.15Compare Source
Fixes
v2.2.14Compare Source
Fixes
v2.2.13Compare Source
Fixes
Documentation
v2.2.12Compare Source
Fixes
_completed_fetchesdeque in consumer fetcher (#2646)v2.2.11Compare Source
Fixes
v2.2.10Compare Source
Fixes
client_ctx.completeinauth_bytes()(#2631)v2.2.9Compare Source
Fixes
Logging / Error Messages
v2.2.8Compare Source
Fixes
Logging / Error Messages
v2.2.7Compare Source
Fixes
v2.2.6Compare Source
Fixes
v2.2.5Compare Source
Fixes
v2.2.4Compare Source
Fixes
reset_generationafter RebalanceInProgressError; improve CommitFailed error messages (#2614)v2.2.3Compare Source
Fixes
v2.2.2Compare Source
Fixes
v2.2.1Compare Source
Fixes
v2.2.0Compare Source
KafkaProducer
delivery_timeout_ms_tp_locks; get dq with lock in reenqueue()KafkaConsumer
READ_COMMITTED(#2582)MEMBER_ID_REQUIREDerror w/ second join group request (#2598)Potentially Breaking Changes (internal)
ClusterMetadata.add_group_coordinator->add_coordinator+ support txn typelog_start_offsetfrom producer RecordMetadataInternal
DefaultRecordsBuilder.size_in_bytesto classmethodFixes
Tests
test_fetcherv2.1.6Compare Source
Fixes
v2.1.5Compare Source
Fixes
Improvements
metrics_enabled=Falseto disable metrics (#2581)v2.1.4Compare Source
Fixes
Improvements
v2.1.3Compare Source
Fixes
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Never, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.