kevinjqliu commented on code in PR #15750:
URL: https://github.com/apache/iceberg/pull/15750#discussion_r3929027127
##########
open-api/rest-catalog-open-api.py:
##########
@@ -649,6 +649,49 @@ class LoadCredentialsResponse(BaseModel):
)
+class CatalogObjectLabels(RootModel[dict[str, str]]):
+ """
+ Catalog-object-level labels, attached to the object (table, view, ...) as
a whole.
+ """
+
+ root: dict[str, str]
+
+
+class FieldLabels(BaseModel):
+ """
+ Labels attached to a single field, identified by field-id.
+ """
+
+ field_id: int = Field(
+ ...,
+ alias='field-id',
+ description='Field ID from the schema of the table or view',
+ )
+ labels: dict[str, str] = Field(
+ ..., description='Flat key-value labels for this field'
Review Comment:
nit: if k/v is flat here, should we also mention that its flat in
`CatalogObjectLabels`?
##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -3849,6 +3849,51 @@ components:
items:
$ref: '#/components/schemas/StorageCredential'
+ CatalogObjectLabels:
+ type: object
+ description: >-
+ Catalog-object-level labels, attached to the object (table, view, ...)
+ as a whole.
+ additionalProperties:
+ type: string
+
+ FieldLabels:
+ type: object
+ description: Labels attached to a single field, identified by field-id.
+ required:
+ - field-id
+ - labels
+ properties:
+ field-id:
+ type: integer
+ description: Field ID from the schema of the table or view
+ labels:
+ type: object
+ description: Flat key-value labels for this field
+ additionalProperties:
+ type: string
+
+ Labels:
+ type: object
+ description: |
+ Catalog-provided metadata enrichment (for example ownership,
+ classification, or cost attribution) returned with a table or view.
+ Labels are catalog-provided and optional; clients may ignore them, and
+ may cache them following the response ETag.
+ The spec does not require how a catalog produces or stores labels, nor
+ whether they are persisted or versioned. `object-labels` carries
+ catalog-object-level labels; `fields` carries per-field labels, each
Review Comment:
nit: i find "catalog-object-level labels" somewhat confusing. These labels
are catalog-provided and attach to tables or views.
Is it named `catalog-object` because it can be for both table and view?
##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -3849,6 +3849,51 @@ components:
items:
$ref: '#/components/schemas/StorageCredential'
+ CatalogObjectLabels:
+ type: object
+ description: >-
+ Catalog-object-level labels, attached to the object (table, view, ...)
+ as a whole.
+ additionalProperties:
+ type: string
+
+ FieldLabels:
+ type: object
+ description: Labels attached to a single field, identified by field-id.
+ required:
+ - field-id
+ - labels
+ properties:
+ field-id:
+ type: integer
+ description: Field ID from the schema of the table or view
+ labels:
+ type: object
+ description: Flat key-value labels for this field
+ additionalProperties:
+ type: string
+
+ Labels:
+ type: object
+ description: |
+ Catalog-provided metadata enrichment (for example ownership,
+ classification, or cost attribution) returned with a table or view.
+ Labels are catalog-provided and optional; clients may ignore them, and
+ may cache them following the response ETag.
+ The spec does not require how a catalog produces or stores labels, nor
+ whether they are persisted or versioned. `object-labels` carries
+ catalog-object-level labels; `fields` carries per-field labels, each
Review Comment:
i like the explanation here:
```
Catalog-object-level labels, attached to the object (table, view,
...)
```
I think the spec can be more clear if we clarity `object`/`catalog-object`
and use consistent naming (`object-labels` vs `CatalogObjectLabels`)
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]