sundapeng opened a new pull request, #10309:
URL: https://github.com/apache/paimon/pull/10309

   ### Purpose
   
   pypaimon's REST client sends the python-requests default User-Agent, so its 
catalog requests can't be told apart from other Python clients. PVFS sets the 
option `header.HTTP_USER_AGENT`, which sends a header literally named 
`HTTP_USER_AGENT` instead of the User-Agent.
   
   REST requests now carry Paimon's unified User-Agent format, 
`<module>(<transport>[;<feature>...])[ <extended>]`, the one the OSS requests 
adopt as well:
   - `pypaimon/<version>(python-requests/<version>)` for the catalog client and 
the DLF ECS token loader. The version is the one `build_info` embeds at build 
time.
   - A user-set `header.User-Agent` still takes precedence.
   - The option key is fixed to `header.User-Agent`, and PVFS adds itself as a 
feature.
   
   Examples, captured on a local endpoint:
   
   | Client | User-Agent |
   |---|---|
   | REST catalog | `pypaimon/2.2.dev(python-requests/2.34.2)` |
   | REST catalog with `header.User-Agent=starrocks/user` | `starrocks/user` |
   | PVFS | `pypaimon/2.2.dev(python-requests/2.34.2;PythonPVFS)` |
   
   Related: #10307 (Python OSS), which adds the same `build_info.version()`.
   
   ### Tests
   
   `rest_user_agent_test.py`: 9 new cases, several against a local HTTP server; 
35 tests passed together with the existing REST client, token loader and API 
tests.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to