Fokko commented on code in PR #14462:
URL: https://github.com/apache/iceberg/pull/14462#discussion_r2490421392


##########
open-api/rest-catalog-open-api.py:
##########
@@ -143,8 +143,19 @@ class FalseExpression(BaseModel):
     )
 
 
-class Reference(BaseModel):
-    __root__: str = Field(..., example=['column-name'])
+class NamedReference(BaseModel):
+    __root__: str = Field(
+        ..., description='Reference to a column by its name', 
example=['column-name']
+    )
+
+
+class IDReference(BaseModel):
+    """
+    Reference to a column by its field ID
+    """
+
+    type: str = Field('reference', const=True)
+    source_id: int = Field(..., alias='source-id')

Review Comment:
   I always dislike that it can be either a primitive (`str` in this case) or 
an object. Why not just encode the field-ID as an integer? When we find an 
integer, we know that we need to interpret it as a field-ID.



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