Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

httpx migration problems #1882

Open
3 of 7 tasks
xdgrulez opened this issue Dec 19, 2024 · 4 comments
Open
3 of 7 tasks

httpx migration problems #1882

xdgrulez opened this issue Dec 19, 2024 · 4 comments

Comments

@xdgrulez
Copy link

Description

Seems that the Python client with the latest update to 2.6.2 is broken...

All kinds of modules probably required for httpx are seemingly not listed in the dependencies of confluent_kafka and when you import confluent_kafka, you get all kinds of errors like this:

ModuleNotFoundError: No module named 'httpx'
ModuleNotFoundError: No module named 'cachetools'
ModuleNotFoundError: No module named 'google.type'

etc.

How to reproduce

import confluent_kafka
from confluent_kafka.schema_registry.avro import AvroDeserializer
Traceback (most recent call last):
File "", line 1, in
File "/tmp/bla/venv/lib/python3.10/site-packages/confluent_kafka/schema_registry/init.py", line 20, in
from .schema_registry_client import (
File "/tmp/bla/venv/lib/python3.10/site-packages/confluent_kafka/schema_registry/schema_registry_client.py", line 26, in
import httpx
ModuleNotFoundError: No module named 'httpx'
from confluent_kafka.schema_registry.json_schema import JSONDeserializer
Traceback (most recent call last):
File "", line 1, in
File "/tmp/bla/venv/lib/python3.10/site-packages/confluent_kafka/schema_registry/init.py", line 20, in
from .schema_registry_client import (
File "/tmp/bla/venv/lib/python3.10/site-packages/confluent_kafka/schema_registry/schema_registry_client.py", line 26, in
import httpx
ModuleNotFoundError: No module named 'httpx'
from confluent_kafka.schema_registry.protobuf import ProtobufDeserializer
Traceback (most recent call last):
File "", line 1, in
File "/tmp/bla/venv/lib/python3.10/site-packages/confluent_kafka/schema_registry/init.py", line 20, in
from .schema_registry_client import (
File "/tmp/bla/venv/lib/python3.10/site-packages/confluent_kafka/schema_registry/schema_registry_client.py", line 26, in
import httpx
ModuleNotFoundError: No module named 'httpx'

...and if you install httpx, you get other missing dependencies...

I think these dependencies should be part of confluent_kafka and should not have to be installed manually by the user...

Checklist

Please provide the following information:

  • confluent-kafka-python and librdkafka version (confluent_kafka.version() and confluent_kafka.libversion()): 2.6.2
  • Apache Kafka broker version: doesn't matter here
  • Client configuration: doesn't matter here
  • Operating system: doesn't matter here
  • Provide client logs: see above
  • Provide broker log excerpts: doesn't matter here
  • Critical issue: I think so...
@ealap
Copy link

ealap commented Dec 19, 2024

Same issue as #1879.

They suddenly decided on a patch version to make requirements for schema registry and other serializer/deserializers optional.

From updated README, you now have to install it as

pip install confluent-kafka[schemaregistry]

# or if you need one of serializers/deserializers like avro

pip install confluent-kafka[avro,schemaregistry]

@Nemeczek
Copy link

It actually crashed our Databricks jobs... It definately should no be smuggled in as a minor version patch

@scholer
Copy link

scholer commented Dec 23, 2024

@Nemeczek - crashed some of our Databricks jobs as well (although not any production jobs, fortunately). We have previously allowed non-production jobs to not pin minor and/or patch versions for dependencies to allow for security updates. But I guess going forward we will use bots to update package dependencies as needed for these jobs as well.

@tribeiro
Copy link

tribeiro commented Jan 8, 2025

We have a CI build that is failing the same way with version 2.8 of the library.

Installed with conda:

    python-confluent-kafka:           2.8.0-py311h9ecbd09_0           conda-forge      

Error:

../_test_env_placehold_placehold_placehold_p/lib/python3.11/site-packages/confluent_kafka/schema_registry/__init__.py:20: in <module>
    from .schema_registry_client import (
../_test_env_placehold_placehold_placehold_p/lib/python3.11/site-packages/confluent_kafka/schema_registry/schema_registry_client.py:26: in <module>
    import httpx
E   ModuleNotFoundError: No module named 'httpx'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants