Skip to content

Commit

Permalink
Fix iterating over keys when changelog topic is set. (#106)
Browse files Browse the repository at this point in the history
* check assigned topic name for a changelog

* fix testcase to mock property

Co-authored-by: alexanderoberegger <alexander.oberegger@smaxtec.com>
Co-authored-by: Vikram Patki <54442035+patkivikram@users.noreply.github.com>
  • Loading branch information
3 people committed Feb 27, 2021
1 parent 788f310 commit 7d29cad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion faust/stores/rocksdb.py
Expand Up @@ -453,7 +453,7 @@ def _dbs_for_key(self, key: bytes) -> Iterable[DB]:

def _dbs_for_actives(self) -> Iterator[DB]:
actives = self.app.assignor.assigned_actives()
topic = self.table._changelog_topic_name()
topic = self.table.changelog_topic_name
for partition, db in self._dbs.items():
tp = TP(topic=topic, partition=partition)
# for global tables, keys from all
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/stores/test_rocksdb.py
Expand Up @@ -427,7 +427,7 @@ def test__dbs_for_key(self, *, store):
assert list(store._dbs_for_key(b"key")) == [dbs[2]]

def test__dbs_for_actives(self, *, store, table):
table._changelog_topic_name.return_value = "clog"
table.changelog_topic_name = "clog"
store.app.assignor.assigned_actives = Mock(
return_value=[
TP("clog", 1),
Expand Down

0 comments on commit 7d29cad

Please sign in to comment.