geruh commented on code in PR #3530:
URL: https://github.com/apache/iceberg-python/pull/3530#discussion_r3444697914


##########
pyiceberg/types.py:
##########
@@ -57,7 +57,7 @@
 from pyiceberg.utils.parsing import ParseNumberFromBrackets
 from pyiceberg.utils.singleton import Singleton
 
-DECIMAL_REGEX = re.compile(r"decimal\((\d+),\s*(\d+)\)")
+DECIMAL_REGEX = re.compile(r"decimal\(\s*(\d+)\s*,\s*(\d+)\s*\)")
 FIXED = "fixed"
 FIXED_PARSER = ParseNumberFromBrackets(FIXED)

Review Comment:
   Should we align this logic to the other regex too? 
   
   
https://github.com/apache/iceberg/blob/41c8ee43b46017843b304241d250737fd10837af/api/src/main/java/org/apache/iceberg/types/Types.java#L66-L73
   
   ```java
   
     private static final Pattern FIXED = 
Pattern.compile("fixed\\[\\s*(\\d+)\\s*\\]");
     private static final Pattern GEOMETRY_PARAMETERS =
         Pattern.compile("geometry\\s*(?:\\(\\s*([^)]*?)\\s*\\))?", 
Pattern.CASE_INSENSITIVE);
     private static final Pattern GEOGRAPHY_PARAMETERS =
         Pattern.compile(
             "geography\\s*(?:\\(\\s*([^,]*?)\\s*(?:,\\s*(\\w*)\\s*)?\\))?", 
Pattern.CASE_INSENSITIVE);
     private static final Pattern DECIMAL =
         Pattern.compile("decimal\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)");
   ```



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