Skip to content

Commit db979fa

Browse files
committed
fix delimiter count since commas are encoded as two characters
1 parent 58a89d6 commit db979fa

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def get_request_property_chunks(
5555
# todo: Add ability to specify parameter delimiter representation and take into account in property_field_size
5656
property_field_size = (
5757
len(property_field)
58-
+ 1 # The +1 represents the extra character for the delimiter in between properties
58+
+ 2 # The +2 represents the extra characters for encoding the delimiter in between properties
5959
if self.property_limit_type == PropertyLimitType.characters
6060
else 1
6161
)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@
4343
["kate", "laurie", "jaclyn"],
4444
None,
4545
PropertyLimitType.characters,
46-
15,
46+
18,
4747
[["kate", "laurie"], ["jaclyn"]],
4848
id="test_property_chunking_limit_characters",
4949
),
5050
pytest.param(
5151
["laurie", "jaclyn", "kaitlin"],
5252
None,
5353
PropertyLimitType.characters,
54-
12,
54+
14, # laurie%2jaclyn%2 == 14
5555
[["laurie"], ["jaclyn"], ["kaitlin"]],
5656
id="test_property_chunking_includes_extra_delimiter",
5757
),

0 commit comments

Comments
 (0)