Skip to content

Commit

Permalink
Update charm libraries (#94)
Browse files Browse the repository at this point in the history
chore: update charm libraries

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: arturo-seijas <102022572+arturo-seijas@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and arturo-seijas authored Jul 5, 2023
1 parent 09fc81a commit 611ef02
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/charms/data_platform_libs/v0/data_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def _on_topic_requested(self, event: TopicRequestedEvent):

# Increment this PATCH version before using `charmcraft publish-lib` or reset
# to 0 if you are raising the major API version
LIBPATCH = 12
LIBPATCH = 13

PYDEPS = ["ops>=2.0.0"]

Expand Down Expand Up @@ -1200,6 +1200,18 @@ def __init__(
self.topic = topic
self.consumer_group_prefix = consumer_group_prefix or ""

@property
def topic(self):
"""Topic to use in Kafka."""
return self._topic

@topic.setter
def topic(self, value):
# Avoid wildcards
if value == "*":
raise ValueError(f"Error on topic '{value}', cannot be a wildcard.")
self._topic = value

def _on_relation_joined_event(self, event: RelationJoinedEvent) -> None:
"""Event emitted when the application joins the Kafka relation."""
# Sets topic, extra user roles, and "consumer-group-prefix" in the relation
Expand Down

0 comments on commit 611ef02

Please sign in to comment.