Copilot commented on code in PR #17137:
URL: https://github.com/apache/iceberg/pull/17137#discussion_r3545935578


##########
open-api/rest-catalog-open-api.py:
##########
@@ -1516,6 +1516,10 @@ class ViewMetadata(BaseModel):
 
 
 class AddSchemaUpdate(BaseUpdate):
+    """
+    Adds a schema to the table. The field IDs in `schema` are assigned by the 
client. The client assigns them so that the schema stays consistent with the 
data files, partition specs, and sort orders it writes or co-commits, which 
reference fields by their field ID (`StructField.id`). Servers SHOULD preserve 
the field IDs submitted by the client on add-schema, as reassigning them would 
require re-deriving and rewriting every such reference, including in 
already-written data files.
+    """

Review Comment:
   The new docstring is a single very long line, which hurts readability and 
can trip formatting/lint checks. Please wrap it to match the multi-line 
docstring style used elsewhere in this file.



##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -3930,6 +3937,9 @@ components:
 
     CreateTableRequest:
       type: object
+      description:
+        Table creation request. The field IDs in `schema` are assigned by the 
client, but because a newly
+        created table has no committed data, a server MAY (re)assign them when 
creating the table.

Review Comment:
   If a server MAY (re)assign field IDs during create, the spec should also 
state that it MUST remap any submitted structures that reference field IDs 
(e.g., `partition-spec`, `write-order`, and `identifier-field-ids` in the 
schema) to keep the created table consistent.



##########
open-api/rest-catalog-open-api.py:
##########
@@ -1636,6 +1640,10 @@ class CommitTransactionRequest(BaseModel):
 
 
 class CreateTableRequest(BaseModel):
+    """
+    Table creation request. The field IDs in `schema` are assigned by the 
client, but because a newly created table has no committed data, a server MAY 
(re)assign them when creating the table.
+    """

Review Comment:
   This docstring is currently one long line. Also, if the server chooses to 
(re)assign field IDs on create, it must remap any request components that 
reference those IDs (e.g., `partition-spec`, `write-order`, and 
`identifier-field-ids` within the submitted schema) to keep the created table 
consistent.



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

Reply via email to