Copilot commented on code in PR #14637:
URL: https://github.com/apache/gravitino/pull/14637#discussion_r4475390983
##########
docs/manage-view-metadata-using-gravitino.md:
##########
@@ -95,17 +125,24 @@ curl -X GET -H "Accept: application/vnd.gravitino.v1+json"
\
View view = views.loadView(NameIdentifier.of("public", "active_customers"));
```
+</TabItem>
+<TabItem value="python" label="Python">
+
+```python
+view = views.load_view(NameIdentifier.of("public", "active_customers"))
+```
+
</TabItem>
</Tabs>
### Alter a View
-| Change | JSON
| Java |
-|--------------------|--------------------------------------------------------------|--------------------------------------------|
-| Rename | `{"@type":"rename","newName":"view_renamed"}`
| `ViewChange.rename("view_renamed")` |
-| Update the comment | `{"@type":"updateComment","newComment":"new_comment"}`
| `ViewChange.updateComment("new_comment")` |
-| Set a property |
`{"@type":"setProperty","property":"key1","value":"value1"}` |
`ViewChange.setProperty("key1", "value1")` |
-| Remove a property | `{"@type":"removeProperty","property":"key1"}`
| `ViewChange.removeProperty("key1")` |
+| Change | JSON
| Java | Python
|
+|--------------------|--------------------------------------------------------------|--------------------------------------------|--------------------------------------------|
+| Rename | `{"@type":"rename","newName":"view_renamed"}`
| `ViewChange.rename("view_renamed")` |
`ViewChange.rename("view_renamed")` |
+| Set a property |
`{"@type":"setProperty","property":"key1","value":"value1"}` |
`ViewChange.setProperty("key1", "value1")` | `ViewChange.set_property("key1",
"value1")` |
+| Remove a property | `{"@type":"removeProperty","property":"key1"}`
| `ViewChange.removeProperty("key1")` |
`ViewChange.remove_property("key1")` |
+| Replace a view | `{"@type":"replace",...}`
| `ViewChange.replaceView(...)` |
`ViewChange.replace_view(...)` |
Review Comment:
The replacement discriminator is `replaceView`, not `replace`:
`ViewUpdateRequest.java:48` registers only `replaceView`, and the Python
`ReplaceViewRequest` emits that same value. A REST request built from this row
will fail deserialization even after the remaining fields are supplied. Change
the JSON example to use `"@type":"replaceView"`.
--
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]