You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by mg...@apache.org on 2022/06/23 11:26:44 UTC

[avro] branch branch-1.11 updated: AVRO-3542: Scale assignment optimization (#1730)

This is an automated email from the ASF dual-hosted git repository.

mgrigorov pushed a commit to branch branch-1.11
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/branch-1.11 by this push:
     new 3e630d396 AVRO-3542: Scale assignment optimization (#1730)
3e630d396 is described below

commit 3e630d396a31539a3bbc933850ddf9470952b683
Author: Igor Izvekov <iz...@mail.ru>
AuthorDate: Thu Jun 23 14:25:35 2022 +0300

    AVRO-3542: Scale assignment optimization (#1730)
    
    (cherry picked from commit f068da73b8543c9f6d151d1af58a43d8164b5adc)
---
 lang/py/avro/schema.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lang/py/avro/schema.py b/lang/py/avro/schema.py
index 4885e333f..9c2b16d7d 100644
--- a/lang/py/avro/schema.py
+++ b/lang/py/avro/schema.py
@@ -1132,7 +1132,7 @@ def make_avsc_object(json_data: object, names: Optional[avro.name.Names] = None,
                 size = json_data.get("size")
                 if logical_type == "decimal":
                     precision = json_data.get("precision")
-                    scale = 0 if json_data.get("scale") is None else json_data.get("scale")
+                    scale = json_data.get("scale", 0)
                     try:
                         return FixedDecimalSchema(size, name, precision, scale, namespace, names, other_props)
                     except avro.errors.IgnoredLogicalType as warning: