[Python] Remove all to_js usage from bindings examples#31636
Conversation
Review🚨 1 critical, Code ReviewThis code review is in beta and may not always be helpful — use your judgment. Critical (1)
Warnings (5)
Style Guide Review✅ No style-guide issues found. CommandsOnly codeowners can run commands. Post a comment with the command to trigger it.
|
|
This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:
|
There was a problem hiding this comment.
This should be merged after cloudflare/workers-py#138 is merged and released
| api_url2 = api_url | ||
|
|
||
| target = urlparse(api_url2) | ||
| request = Request.new(api_url2, request) |
There was a problem hiding this comment.
Request has a clone method, maybe we can give it an optional URL argument?
dom96
left a comment
There was a problem hiding this comment.
Nice, thanks for fixing these!
| return await fetch(new_request) | ||
| except Exception as e: | ||
| return Response.new({"error": str(e)}, status=500) | ||
| return Response(str(e), status=500) |
There was a problem hiding this comment.
I wonder if the idea here is to return json. Maybe you can use Response.json here?
Summary
Removes remaining
pyodide.ffi.to_jsusage from workers bindings documentation. Python workers team has improved the SDK so that users does not have to manually convert Python objects into JS-serializable object before passing to RPC boundary.Screenshots (optional)
Documentation checklist