Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-evandenberg committed Oct 23, 2024
1 parent 3f1a1ce commit f2af085
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/snowflake/snowpark/_internal/ast_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1346,18 +1346,19 @@ def base64_str_to_request(base64_str: str) -> proto.Request:
return message


def merge_requests(messages: List[proto.Request]) -> proto.Request:
message = proto.Request()
def merge_requests(requests: List[proto.Request]) -> proto.Request:
"""Merge list of requests into a single request through accumulating the request body segments in same order."""
request = proto.Request()

# Copy the client_version, etc as part of first message.
message.CopyFrom(messages[0])
request.CopyFrom(requests[0])

for next_message in messages[1:]:
for next_stmt in next_message.body:
stmt = message.body.add()
for next_request in requests[1:]:
for next_stmt in next_request.body:
stmt = request.body.add()
stmt.CopyFrom(next_stmt)

return message
return request


def base64_lines_to_request(base64_lines: str) -> proto.Request:
Expand Down

0 comments on commit f2af085

Please sign in to comment.