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

Ensure changelog topic configuration doesn't impact data topic config… #716

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions quixstreams/models/topics/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ def topic_config(
return TopicConfig(
num_partitions=num_partitions or self.default_num_partitions,
replication_factor=replication_factor or self.default_replication_factor,
extra_config=extra_config or self.default_extra_config,
# copy the default extra_config to ensure we don't mutate the default
extra_config=extra_config or self.default_extra_config.copy(),
)

def topic(
Expand Down Expand Up @@ -404,7 +405,8 @@ def changelog_topic(
config = self.topic_config(
num_partitions=source_topic_config.num_partitions,
replication_factor=source_topic_config.replication_factor,
extra_config=source_topic_config.extra_config,
# copy the extra_config to ensure we don't mutate the source topic extra config
extra_config=source_topic_config.extra_config.copy(),
)

# always override some default configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ def test_changelog_topic(self, topic_manager_factory):
assert isinstance(getattr(changelog, attr), BytesDeserializer)
assert changelog.config.num_partitions == topic.config.num_partitions
assert changelog.config.replication_factor == topic.config.replication_factor

assert topic.config.extra_config.get("cleanup.policy") != "compact"
assert changelog.config.extra_config["cleanup.policy"] == "compact"

def test_changelog_topic_settings_import(self, topic_manager_factory):
Expand Down
Loading