Skip to content

Commit 01fb6c8

Browse files
committed
Fix comments from review
1 parent fd9b225 commit 01fb6c8

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3059,18 +3059,21 @@ def create_grouping_partition_router(
30593059
if model.group_size < 1:
30603060
raise ValueError(f"Group size must be greater than 0, got {model.group_size}")
30613061

3062-
if not isinstance(underlying_router, PartitionRouter):
3063-
raise ValueError(
3064-
f"Underlying partition router must be a PartitionRouter subclass, got {type(underlying_router)}"
3065-
)
3066-
3062+
# Request options in underlying partition routers are not supported for GroupingPartitionRouter
3063+
# because they are specific to individual partitions and cannot be aggregated or handled
3064+
# when grouping, potentially leading to incorrect API calls. Any request customization
3065+
# should be managed at the stream level or through the retriever's configuration.
30673066
if isinstance(underlying_router, SubstreamPartitionRouter):
30683067
if any(
30693068
parent_config.request_option
30703069
for parent_config in underlying_router.parent_stream_configs
30713070
):
30723071
raise ValueError("Request options are not supported for GroupingPartitionRouter.")
30733072

3073+
if isinstance(underlying_router, ListPartitionRouter):
3074+
if underlying_router.request_option:
3075+
raise ValueError("Request options are not supported for GroupingPartitionRouter.")
3076+
30743077
return GroupingPartitionRouter(
30753078
group_size=model.group_size,
30763079
underlying_partition_router=underlying_router,

0 commit comments

Comments
 (0)