Skip to content

Commit 5c6ff1c

Browse files
committed
adjust property chunking splitting count and tests
1 parent a2478af commit 5c6ff1c

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

airbyte_cdk/sources/declarative/requesters/query_properties/property_chunking.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@ def get_request_property_chunks(
5252
chunk_size = 0
5353
for property_field in property_fields:
5454
# If property_limit_type is not defined, we default to property_count which is just an incrementing count
55-
# +2 for the comma ToDo: Add possibility to specify parameter representation and take it into account in property_field_size
55+
# todo: Add ability to specify parameter delimiter representation and take into account in property_field_size
5656
property_field_size = (
57-
len(property_field) + 2
57+
len(property_field)
58+
+ 1 # The +1 represents the extra character for the delimiter in between properties
5859
if self.property_limit_type == PropertyLimitType.characters
5960
else 1
6061
)

unit_tests/sources/declarative/requesters/query_properties/test_property_chunking.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,18 @@
4343
["kate", "laurie", "jaclyn"],
4444
None,
4545
PropertyLimitType.characters,
46-
10,
47-
[["kate"], ["laurie"], ["jaclyn"]],
46+
15,
47+
[["kate", "laurie"], ["jaclyn"]],
4848
id="test_property_chunking_limit_characters",
4949
),
50+
pytest.param(
51+
["laurie", "jaclyn", "kaitlin"],
52+
None,
53+
PropertyLimitType.characters,
54+
12,
55+
[["laurie"], ["jaclyn"], ["kaitlin"]],
56+
id="test_property_chunking_includes_extra_delimiter",
57+
),
5058
pytest.param(
5159
[],
5260
None,

0 commit comments

Comments
 (0)