Skip to content

Commit

Permalink
#20703 source salesforce: review fix
Browse files Browse the repository at this point in the history
  • Loading branch information
davydov-d committed Feb 20, 2023
1 parent f889f34 commit 1af9202
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,16 +136,16 @@ def request_params(
def chunk_properties(self) -> Iterable[Mapping[str, Any]]:
selected_properties = self.get_json_schema().get("properties", {})

def empty_props():
def empty_props_with_pk_if_present():
return {self.primary_key: selected_properties[self.primary_key]} if self.primary_key else {}

summary_length = 0
local_properties = empty_props()
local_properties = empty_props_with_pk_if_present()
for property_name, value in selected_properties.items():
current_property_length = len(urllib.parse.quote(f"{property_name},"))
if current_property_length + summary_length >= self.max_properties_length:
yield local_properties
local_properties = empty_props()
local_properties = empty_props_with_pk_if_present()
summary_length = 0

local_properties[property_name] = value
Expand Down

0 comments on commit 1af9202

Please sign in to comment.