Skip to content

Commit 93cf934

Browse files
committed
Add error for partition with multiple values
1 parent 85d041b commit 93cf934

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

airbyte_cdk/sources/declarative/partition_routers/grouping_partition_router.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ def stream_slices(self) -> Iterable[StreamSlice]:
4848
# Iterate over partitions lazily from the underlying router
4949
for partition in self.underlying_partition_router.stream_slices():
5050
# Extract the partition key (assuming single key-value pair, e.g., {"board_ids": value})
51+
if len(partition.partition.values()) != 1:
52+
raise ValueError(
53+
f"GroupingPartitionRouter expects a single partition key-value pair. Got {partition.partition}"
54+
)
5155
key = next(iter(partition.partition.values()), None)
5256

5357
# Skip duplicates if deduplication is enabled

0 commit comments

Comments
 (0)