Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(weave): feedback payload 1024 -> 1024*1024 #3023

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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 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" * 1024 * 1024
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am surprised this passes since the size check is for a value > than this (not >=) but InvalidRequest still gets raised?

Copy link
Member Author

Choose a reason for hiding this comment

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

thats a great point. 🤔 I will take a peek at why, as well as come up with some testing apparatus in a local trace server to iron out any slow points / loading states needed in the feedback grid

req = tsi.FeedbackCreateReq(
project_id=project_id,
wb_user_id="VXNlcjo0NTI1NDQ=",
Expand Down
3 changes: 2 additions & 1 deletion weave/trace_server/clickhouse_trace_server_batched.py
Original file line number Diff line number Diff line change
Expand Up @@ -1350,7 +1350,8 @@ 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
# 1MB max payload size
MAX_PAYLOAD = 1024 * 1024
if len(payload) > MAX_PAYLOAD:
raise InvalidRequest("Feedback payload too large")
row: Row = {
Expand Down
Loading