sunyuhan1998 opened a new issue, #10753:
URL: https://github.com/apache/gravitino/issues/10753

   ### Version
   
   main branch
   
   ### Describe what's wrong
   
   The `alter_tag` method in `GravitinoMetalake` sends tag modification 
requests using HTTP POST, but the server-side `TagOperations` endpoint is 
annotated with `@PUT`. This causes all `alter_tag` calls to fail with an HTTP 
405 error when communicating with a real Gravitino server.
   
   ### Error message and/or stacktrace
   
   requests.exceptions.HTTPError: 405 Client Error: Method Not Allowed for url
   
   ### How to reproduce
   
   1. Start a Gravitino server
   2. Create a metalake and a tag:
   ```
   from gravitino import GravitinoClient
   client = GravitinoClient(uri="http://localhost:8090";, metalake_name="demo")
   client.create_tag("test_tag", "comment", {})
   ```
   3. Attempt to alter the tag:
   ```
   from gravitino.api.tag.tag_change import TagChange
   client.alter_tag("test_tag", TagChange.update_comment("new comment"))
   ```
   4. Observe the 405 error
   
   ### Additional context
   
   **Analysis**
   
     Root cause: In `gravitino/client/gravitino_metalake.py` line 663, the 
`alter_tag` method calls `self.rest_client.post()` instead of 
`self.rest_client.put()`.
   
   **Why existing tests didn't catch this**
   The unit test at `test_tag_api.py`:`test_gravitino_metalake_alter_tag_api` 
mocked `HTTPClient.post` instead of `HTTPClient.put`, so the incorrect HTTP 
method was never validated against the server's actual contract.
   
   I will submit a PR to fix it later.


-- 
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