Skip to content

Commit

Permalink
fix(weave): Bump feedback payload size limit to 1 MiB (#2926)
Browse files Browse the repository at this point in the history
* fix(weave): Bump feedback payload size limit to 1 MiB

* revert conftest lol
  • Loading branch information
adrnswanberg authored Dec 18, 2024
1 parent 0904899 commit af7e421
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/trace/test_client_feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def test_feedback_payload(client):
def test_feedback_create_too_large(client):
project_id = client._project_id()

value = "a" * 10000
value = "a" * (1 << 21) # > 1 MiB, past the limit
req = tsi.FeedbackCreateReq(
project_id=project_id,
wb_user_id="VXNlcjo0NTI1NDQ=",
Expand Down
2 changes: 1 addition & 1 deletion weave/trace_server/clickhouse_trace_server_batched.py
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,7 @@ def feedback_create(self, req: tsi.FeedbackCreateReq) -> tsi.FeedbackCreateRes:
created_at = datetime.datetime.now(ZoneInfo("UTC"))
# TODO: Any validation on weave_ref?
payload = _dict_value_to_dump(req.payload)
MAX_PAYLOAD = 1024
MAX_PAYLOAD = 1 << 20 # 1 MiB
if len(payload) > MAX_PAYLOAD:
raise InvalidRequest("Feedback payload too large")
row: Row = {
Expand Down

0 comments on commit af7e421

Please sign in to comment.