From af7e4215f084a079348575e546b4eee22334e7da Mon Sep 17 00:00:00 2001 From: Adrian Swanberg Date: Tue, 17 Dec 2024 17:08:50 -0800 Subject: [PATCH] fix(weave): Bump feedback payload size limit to 1 MiB (#2926) * fix(weave): Bump feedback payload size limit to 1 MiB * revert conftest lol --- tests/trace/test_client_feedback.py | 2 +- weave/trace_server/clickhouse_trace_server_batched.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/trace/test_client_feedback.py b/tests/trace/test_client_feedback.py index 82d87198e133..c01127370a5a 100644 --- a/tests/trace/test_client_feedback.py +++ b/tests/trace/test_client_feedback.py @@ -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=", diff --git a/weave/trace_server/clickhouse_trace_server_batched.py b/weave/trace_server/clickhouse_trace_server_batched.py index 973d51080e29..e97e020b1abe 100644 --- a/weave/trace_server/clickhouse_trace_server_batched.py +++ b/weave/trace_server/clickhouse_trace_server_batched.py @@ -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 = {