Copilot commented on code in PR #12510: URL: https://github.com/apache/gravitino/pull/12510#discussion_r3811850407
########## docs/tags.md: ########## @@ -82,6 +82,24 @@ every object carrying the tag sees the same values. Properties suit facts about which team owns it or which external system it came from. Properties do not suit facts about one tagged object. +Assignment values describe one tag on one object. For example, the same `data_domain` tag can have +the value `finance` on one table and `risk` on another. An assignment can have no value, one value, +or several values. Adding a value is incremental, so adding `risk` to an assignment that already has +`finance` leaves both values in place. + +When you create a tag, you can choose one of three value constraints: + +| Constraint | Meaning | +|------------|---------| +| Any value | The tag accepts any non-blank string, and can also be assigned without a value | +| No value | The tag can only be assigned without a value | +| Allowed values | The tag accepts only values from the configured list | Review Comment: The markdown table is formatted with a double leading pipe (`||`), which typically renders as an extra empty column (or breaks formatting depending on the renderer). Use single leading pipes for a 2-column table, e.g. `| Constraint | Meaning |` and `| --- | --- |`. ########## docs/manage-tags-in-gravitino.md: ########## @@ -263,6 +370,7 @@ curl -X GET -H "Accept: application/vnd.gravitino.v1+json" \ Table customers = ... String[] tagNames = customers.supportsTags().listTags(); Tag[] tags = customers.supportsTags().listTagsInfo(); +String[] values = tags[0].assignment().get().values(); Review Comment: The Java example uses `Optional.get()` (`assignment().get()`), which encourages an unsafe pattern and will throw if the assignment is absent (e.g., depending on what `listTagsInfo()` returns for inherited/valueless cases). Prefer showing a safe access pattern (e.g., `orElse(...)`, `orElseThrow(...)` with a clear message, or a helper that exposes assignment values directly if available) so the docs don’t promote a fragile usage. -- 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]
