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 2021/04/01 16:28:04 UTC
[GitHub] [avro] subhashb commented on a change in pull request #1167: AVRO-1938: Generate Parsing Canonical Forms of Schema
subhashb commented on a change in pull request #1167:
URL: https://github.com/apache/avro/pull/1167#discussion_r605790522
##########
File path: lang/py/avro/schema.py
##########
@@ -136,7 +147,18 @@ def _is_timezone_aware_datetime(dt):
# Base Classes
#
-class Schema(abc.ABC):
+class CanonicalPropertiesMixin(object):
+ """A Mixin that provides canonical properties to Schema and Field types."""
+ @property
+ def canonical_properties(self):
+ props = self.props
+ return collections.OrderedDict(
Review comment:
While keys are inserted in the order specified by the canonical form, dictionary order is guaranteed only in Python 3.7 and above. So I believe we still need this to be `OrderedDict`.
If we were to stop supporting 3.6 someday, we could revert to using a dictionary; I believe it would work without any changes.
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org