Skip to content

Inconsistent constructor usage in docs #321

@ecksun

Description

@ecksun

Description

The examples in the README does not correspond to the API documentation.

For example in the README it says:

from confluent_kafka import Consumer, KafkaError

c = Consumer({'bootstrap.servers': 'mybroker', 'group.id': 'mygroup',
              'default.topic.config': {'auto.offset.reset': 'smallest'}})

However in the API docs the constructor looks like this:

Consumer(**kwargs)

This was rather confusing when starting out. Moreover my IDE considered the form in the README to be invalid (it did not match the signature).

The examples also look like what I would expect.

Thus I suggest to change the README to Consumer(**{...}).

Edit: The same is also true for the constructors of Producer and the Avro constructors as well

How to reproduce

N/A

Checklist

Please provide the following information:

  • confluent-kafka-python and librdkafka version (confluent_kafka.version() and confluent_kafka.libversion()): N/A
  • Apache Kafka broker version: N/A
  • Client configuration: N/A
  • Operating system: N/A
  • Provide client logs (with 'debug': '..' as necessary): N/A
  • Provide broker log excerpts: N/A
  • Critical issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsRequesting a documentation changeenhancementRequesting a feature change

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy