You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by GitBox <gi...@apache.org> on 2022/06/16 18:31:44 UTC

[GitHub] [avro] RyanSkraba commented on a diff in pull request #1689: AVRO-3521: "Scale" property from decimal object

RyanSkraba commented on code in PR #1689:
URL: https://github.com/apache/avro/pull/1689#discussion_r899406407


##########
lang/py/avro/io.py:
##########
@@ -699,7 +699,7 @@ def read_data(self, writers_schema: avro.schema.Schema, readers_schema: avro.sch
                     warnings.warn(avro.errors.IgnoredLogicalType(f"Invalid decimal precision {precision}. Must be a positive integer."))
                     return decoder.read_bytes()
                 scale = writers_schema.get_prop("scale")
-                if not (isinstance(scale, int) and scale > 0):
+                if not (isinstance(scale, int) and scale >= 0):
                     warnings.warn(avro.errors.IgnoredLogicalType(f"Invalid decimal scale {scale}. Must be a positive integer."))

Review Comment:
   ```suggestion
                       warnings.warn(avro.errors.IgnoredLogicalType(f"Invalid decimal scale {scale}. Must be a non-negative integer."))
   ```



-- 
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: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org