From bc0f7abfe202f59bf3b5aaa3e25946c20321865d Mon Sep 17 00:00:00 2001 From: Denys Davydov Date: Fri, 10 Jun 2022 22:08:01 +0300 Subject: [PATCH] #268 oncall: review fix --- .../connectors/source-hubspot/source_hubspot/streams.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/airbyte-integrations/connectors/source-hubspot/source_hubspot/streams.py b/airbyte-integrations/connectors/source-hubspot/source_hubspot/streams.py index d498081aff99..4ac76eac6d44 100644 --- a/airbyte-integrations/connectors/source-hubspot/source_hubspot/streams.py +++ b/airbyte-integrations/connectors/source-hubspot/source_hubspot/streams.py @@ -64,13 +64,14 @@ def split_properties(properties_list: List[str]) -> Iterator[Tuple[str]]: summary_length = 0 local_properties = [] for property_ in properties_list: - if len(urllib.parse.quote(f"property={property_}&")) + summary_length >= PROPERTIES_PARAM_MAX_LENGTH: + current_property_length = len(urllib.parse.quote(f"property={property_}&")) + if current_property_length + summary_length >= PROPERTIES_PARAM_MAX_LENGTH: yield local_properties local_properties = [] summary_length = 0 local_properties.append(property_) - summary_length += len(urllib.parse.quote(f"property={property_}&")) + summary_length += current_property_length if local_properties: yield local_properties