Skip to content

Commit cbbcea8

Browse files
committed
requested by review
1 parent 5999c3a commit cbbcea8

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

quixstreams/dataframe/registry.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ def register_groupby(
7070
Register a "groupby" SDF, which is one generated with `SDF.group_by()`.
7171
:param source_sdf: the SDF used by `sdf.group_by()`
7272
:param new_sdf: the SDF generated by `sdf.group_by()`.
73+
:param register_new_root: whether to register the new SDF as a root SDF.
7374
"""
7475
if source_sdf.stream_id in self._repartition_origins:
7576
raise GroupByNestingLimit(
@@ -78,7 +79,7 @@ def register_groupby(
7879

7980
if new_sdf.stream_id in self._repartition_origins:
8081
raise GroupByDuplicate(
81-
"A `SDF.group_by()` operation appears to be the same as another, "
82+
"An `SDF.group_by()` operation appears to be the same as another, "
8283
"either from using the same column or name parameter; "
8384
"adjust by setting a unique name with `SDF.group_by(name=<NAME>)` "
8485
)
@@ -90,7 +91,7 @@ def register_groupby(
9091
self.register_root(new_sdf)
9192
except StreamingDataFrameDuplicate:
9293
raise GroupByDuplicate(
93-
"A `SDF.group_by()` operation appears to be the same as another, "
94+
"An `SDF.group_by()` operation appears to be the same as another, "
9495
"either from using the same column or name parameter; "
9596
"adjust by setting a unique name with `SDF.group_by(name=<NAME>)` "
9697
)

tests/test_quixstreams/test_dataframe/test_dataframe.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1682,10 +1682,11 @@ def test_group_by_column(
16821682
sdf = sdf.group_by(col)
16831683
sdf[col] = col_update
16841684

1685-
groupby_topic = sdf.topics[0]
16861685
if num_partitions == 1:
1686+
groupby_topic = topic
16871687
assert sdf_registry.consumer_topics == [topic]
16881688
else:
1689+
groupby_topic = sdf.topics[0]
16891690
assert sdf_registry.consumer_topics == [topic, groupby_topic]
16901691
assert groupby_topic.name.startswith("repartition__")
16911692

@@ -1773,10 +1774,11 @@ def test_group_by_column_with_name(
17731774
sdf = sdf.group_by(col, name=op_name)
17741775
sdf[col] = col_update
17751776

1776-
groupby_topic = sdf.topics[0]
17771777
if num_partitions == 1:
1778+
groupby_topic = topic
17781779
assert sdf_registry.consumer_topics == [topic]
17791780
else:
1781+
groupby_topic = sdf.topics[0]
17801782
assert sdf_registry.consumer_topics == [topic, groupby_topic]
17811783
assert groupby_topic.name.startswith("repartition__")
17821784

@@ -1864,10 +1866,11 @@ def test_group_by_func(
18641866
sdf = sdf.group_by(lambda v: v[col], name=op_name)
18651867
sdf[col] = col_update
18661868

1867-
groupby_topic = sdf.topics[0]
18681869
if num_partitions == 1:
1870+
groupby_topic = topic
18691871
assert sdf_registry.consumer_topics == [topic]
18701872
else:
1873+
groupby_topic = sdf.topics[0]
18711874
assert sdf_registry.consumer_topics == [topic, groupby_topic]
18721875
assert groupby_topic.name.startswith("repartition__")
18731876

0 commit comments

Comments
 (0)