rambleraptor commented on code in PR #3613:
URL: https://github.com/apache/iceberg-python/pull/3613#discussion_r3546932832


##########
pyiceberg/schema.py:
##########
@@ -1697,10 +1697,10 @@ def _(file_type: BinaryType, read_type: IcebergType) -> 
IcebergType:
 @promote.register(DecimalType)
 def _(file_type: DecimalType, read_type: IcebergType) -> IcebergType:
     if isinstance(read_type, DecimalType):
-        if file_type.precision <= read_type.precision and file_type.scale == 
file_type.scale:
+        if file_type.precision <= read_type.precision and file_type.scale == 
read_type.scale:
             return read_type
         else:
-            raise ResolveError(f"Cannot reduce precision from {file_type} to 
{read_type}")
+            raise ResolveError(f"Cannot promote {file_type} to {read_type}")

Review Comment:
   Can we change this back? The old error message better helped users 
understand the issue.



##########
pyiceberg/schema.py:
##########
@@ -1697,10 +1697,10 @@ def _(file_type: BinaryType, read_type: IcebergType) -> 
IcebergType:
 @promote.register(DecimalType)
 def _(file_type: DecimalType, read_type: IcebergType) -> IcebergType:
     if isinstance(read_type, DecimalType):
-        if file_type.precision <= read_type.precision and file_type.scale == 
file_type.scale:

Review Comment:
   Oh, this was always true! Well, that's not ideal.



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