Skip to content

Commit 331dc86

Browse files
authored
fix(property chunking): fix delimiter count since commas are encoded as three characters (#495)
1 parent 58a89d6 commit 331dc86

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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+
+ 3 # The +3 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+
20,
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+
17, # laurie%2Cjaclyn%2C == 18, so this will create separate chunks
5555
[["laurie"], ["jaclyn"], ["kaitlin"]],
5656
id="test_property_chunking_includes_extra_delimiter",
5757
),

0 commit comments

Comments
 (0)