Skip to content

Commit 6cb895e

Browse files
committed
Fix mypy errors
1 parent 4d8c918 commit 6cb895e

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

airbyte_cdk/sources/declarative/declarative_component_schema.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3436,7 +3436,6 @@ definitions:
34363436
title: Group Size
34373437
description: The number of partitions to include in each group. This determines how many partition values are batched together in a single slice.
34383438
type: integer
3439-
minimum: 1
34403439
examples:
34413440
- 10
34423441
- 50

airbyte_cdk/sources/declarative/models/declarative_component_schema.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from enum import Enum
77
from typing import Any, Dict, List, Literal, Optional, Union
88

9-
from pydantic.v1 import BaseModel, Extra, Field, conint
9+
from pydantic.v1 import BaseModel, Extra, Field
1010

1111

1212
class AuthFlowType(Enum):
@@ -2373,7 +2373,7 @@ class SubstreamPartitionRouter(BaseModel):
23732373

23742374
class GroupingPartitionRouter(BaseModel):
23752375
type: Literal["GroupingPartitionRouter"]
2376-
group_size: conint(ge=1) = Field(
2376+
group_size: int = Field(
23772377
...,
23782378
description="The number of partitions to include in each group. This determines how many partition values are batched together in a single slice.",
23792379
examples=[10, 50],

airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3056,6 +3056,8 @@ def create_grouping_partition_router(
30563056
underlying_router = self._create_component_from_model(
30573057
model=model.underlying_partition_router, config=config
30583058
)
3059+
if model.group_size < 1:
3060+
raise ValueError(f"Group size must be greater than 0, got {model.group_size}")
30593061

30603062
if not isinstance(underlying_router, PartitionRouter):
30613063
raise ValueError(

airbyte_cdk/sources/declarative/partition_routers/grouping_partition_router.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def stream_slices(self) -> Iterable[StreamSlice]:
4040
Iterable[StreamSlice]: An iterable of StreamSlice objects, where each slice contains a batch of partition values.
4141
"""
4242
batch = []
43-
seen_keys = set() if self.deduplicate else None
43+
seen_keys = set()
4444

4545
# Iterate over partitions lazily from the underlying router
4646
for partition in self.underlying_partition_router.stream_slices():

0 commit comments

Comments
 (0)