Skip to content

fix: support aiokafka 0.13.0 which removed api_version parameter#674

Open
nightcityblade wants to merge 1 commit intofaust-streaming:masterfrom
nightcityblade:fix/issue-672
Open

fix: support aiokafka 0.13.0 which removed api_version parameter#674
nightcityblade wants to merge 1 commit intofaust-streaming:masterfrom
nightcityblade:fix/issue-672

Conversation

@nightcityblade
Copy link

Description

aiokafka 0.13.0 removed the api_version parameter from both AIOKafkaConsumer and AIOKafkaProducer. Since faust requires aiokafka>=0.10.0, it needs to handle both old and new versions.

This adds a version check (_AIOKAFKA_HAS_API_VERSION) and conditionally includes api_version in the consumer and producer kwargs only when running with aiokafka < 0.13.0.

Fixes #672

Changes

  • faust/transport/drivers/aiokafka.py: Added version check, conditionally pass api_version to consumer and producer
  • tests/unit/transport/drivers/test_aiokafka.py: Updated tests to handle both aiokafka versions

Testing

All 134 tests pass (23 skipped, including 1 for the api_version parametrized test on aiokafka >= 0.13.0).

aiokafka 0.13.0 removed the `api_version` parameter from both
`AIOKafkaConsumer` and `AIOKafkaProducer`. Since faust requires
`aiokafka>=0.10.0`, it needs to handle both old and new versions.

This adds a version check and conditionally includes `api_version`
only when running with aiokafka < 0.13.0.

Fixes faust-streaming#672
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Faust Worker Error with aiokafka 0.13.0

1 participant