Skip to content

Commit

Permalink
type correction
Browse files Browse the repository at this point in the history
  • Loading branch information
PratRanj07 committed Dec 19, 2024
1 parent b85c6e3 commit bd9120d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions examples/adminapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
TopicCollection, IsolationLevel,
ConsumerGroupType, ElectionType)
from confluent_kafka.admin import (AdminClient, NewTopic, NewPartitions, ConfigResource,
ConfigEntry, ConfigSource, AclBinding,
ConfigEntry, ConfigSource, ConfigType, AclBinding,
AclBindingFilter, ResourceType, ResourcePatternType,
AclOperation, AclPermissionType, AlterConfigOpType,
ScramMechanism, ScramCredentialInfo,
Expand Down Expand Up @@ -103,13 +103,13 @@ def example_create_partitions(a, topics):


def print_config(config, depth):
print('%40s = %-50s [%s,is:read-only=%r,default=%r,sensitive=%r,synonym=%r,synonyms=%s,type=%r, documentation=%s]' %
print('%40s = %-50s [%s,is:read-only=%r,default=%r,sensitive=%r,synonym=%r,synonyms=%s,type=%s, documentation=%s]' %
((' ' * depth) + config.name, config.value, ConfigSource(config.source),
config.is_read_only, config.is_default,
config.is_sensitive, config.is_synonym,
["%s:%s" % (x.name, ConfigSource(x.source))
for x in iter(config.synonyms.values())],
config.type, config.documentation))
ConfigType(config.type), config.documentation))


def example_describe_configs(a, args):
Expand Down
1 change: 1 addition & 0 deletions src/confluent_kafka/admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

# Unused imports are keeped to be accessible using this public module
from ._config import (ConfigSource, # noqa: F401
ConfigType,
ConfigEntry,
ConfigResource,
AlterConfigOpType)
Expand Down
3 changes: 2 additions & 1 deletion src/confluent_kafka/admin/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import functools
from .. import cimpl as _cimpl
from ._resource import ResourceType
from .._util import ConversionUtil


class AlterConfigOpType(Enum):
Expand Down Expand Up @@ -121,7 +122,7 @@ def __init__(self, name, value,
"""Indicates whether the configuration property is a synonym for the parent configuration entry."""
self.synonyms = synonyms
"""A list of synonyms (ConfigEntry) and alternate sources for this configuration property."""
self.type = type
self.type = ConversionUtil.convert_to_enum(type, ConfigType)
"""The type of the configuration property."""
self.documentation = documentation
"""The documentation for the configuration property."""
Expand Down

0 comments on commit bd9120d

Please sign in to comment.