Copilot commented on code in PR #3530: URL: https://github.com/apache/iceberg-python/pull/3530#discussion_r3444184418
########## 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*\)") Review Comment: `DECIMAL_REGEX` is not anchored, so `_parse_decimal_type` will accept strings with trailing junk like `decimal(9,2)foo` (the regex will match the valid prefix and ignore the rest). Since this PR is already adjusting decimal parsing behavior, it’s a good opportunity to require the entire string to be a decimal type (optionally with surrounding whitespace). -- 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]
