Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ragas/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def upload_packet(path: str, data_json_string: str):

response = requests.post(
f"{base_url}/api/v1{path}",
data=data_json_string,
data=data_json_string.encode('utf-8'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change may fix UTF-8 encoding issues but introduces potential runtime errors if data_json_string isn't always a string type.

Consider adding a type checking:

data=data_json_string.encode('utf-8') if isinstance(data_json_string, str) else data_json_string,

something like that.

headers=headers,
timeout=(connection_timeout, read_timeout),
)
Expand Down