structurize 2.16.6__py3-none-any.whl → 2.17.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- avrotize/__init__.py +1 -0
- avrotize/_version.py +3 -3
- avrotize/avrotocsharp.py +74 -10
- avrotize/avrotojava.py +1130 -51
- avrotize/avrotopython.py +4 -2
- avrotize/commands.json +671 -53
- avrotize/common.py +6 -1
- avrotize/jsonstoavro.py +518 -49
- avrotize/structuretocpp.py +697 -0
- avrotize/structuretocsv.py +365 -0
- avrotize/structuretodatapackage.py +659 -0
- avrotize/structuretodb.py +1125 -0
- avrotize/structuretogo.py +720 -0
- avrotize/structuretographql.py +502 -0
- avrotize/structuretoiceberg.py +355 -0
- avrotize/structuretojava.py +853 -0
- avrotize/structuretokusto.py +639 -0
- avrotize/structuretomd.py +322 -0
- avrotize/structuretoproto.py +764 -0
- avrotize/structuretorust.py +714 -0
- avrotize/structuretoxsd.py +679 -0
- {structurize-2.16.6.dist-info → structurize-2.17.0.dist-info}/METADATA +1 -1
- {structurize-2.16.6.dist-info → structurize-2.17.0.dist-info}/RECORD +27 -14
- {structurize-2.16.6.dist-info → structurize-2.17.0.dist-info}/WHEEL +0 -0
- {structurize-2.16.6.dist-info → structurize-2.17.0.dist-info}/entry_points.txt +0 -0
- {structurize-2.16.6.dist-info → structurize-2.17.0.dist-info}/licenses/LICENSE +0 -0
- {structurize-2.16.6.dist-info → structurize-2.17.0.dist-info}/top_level.txt +0 -0
avrotize/common.py
CHANGED
|
@@ -5,6 +5,7 @@ Common utility functions for Avrotize.
|
|
|
5
5
|
# pylint: disable=too-many-arguments, too-many-locals, too-many-branches, too-many-statements, line-too-long
|
|
6
6
|
|
|
7
7
|
from collections import defaultdict
|
|
8
|
+
import copy
|
|
8
9
|
import os
|
|
9
10
|
import re
|
|
10
11
|
import hashlib
|
|
@@ -698,6 +699,9 @@ def inline_avro_references(avro_schema, type_dict, current_namespace, tracker=No
|
|
|
698
699
|
if 'type' in avro_schema and avro_schema['type'] in ['record', 'enum', 'fixed']:
|
|
699
700
|
namespace = avro_schema.get('namespace', current_namespace)
|
|
700
701
|
qualified_name = (namespace + '.' if namespace else '') + avro_schema['name']
|
|
702
|
+
# If this named type is already defined, return just the reference string
|
|
703
|
+
if qualified_name in defined_types:
|
|
704
|
+
return qualified_name
|
|
701
705
|
defined_types.add(qualified_name)
|
|
702
706
|
|
|
703
707
|
# Process record types
|
|
@@ -731,7 +735,8 @@ def inline_avro_references(avro_schema, type_dict, current_namespace, tracker=No
|
|
|
731
735
|
|
|
732
736
|
elif avro_schema in type_dict and avro_schema not in tracker and avro_schema not in defined_types:
|
|
733
737
|
# Inline the referenced schema if not already tracked and not defined in the current schema
|
|
734
|
-
|
|
738
|
+
# Use deepcopy to avoid mutating the original type_dict entries when modifying nested structures
|
|
739
|
+
inlined_schema = copy.deepcopy(type_dict[avro_schema])
|
|
735
740
|
if isinstance(inlined_schema, dict) and not inlined_schema.get('namespace', None):
|
|
736
741
|
inlined_schema['namespace'] = '.'.join(avro_schema.split('.')[:-1])
|
|
737
742
|
inlined_schema = inline_avro_references(
|