gudjonragnar / fastavro-gen Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Hello, I found this repository very helpful in my project.
I think a good feature would be using the doc field to generate some kind of documentation for the generated dataclasses. For example, with:
{
"name" : "timestamp",
"type" : {
"type" : "long",
"logicalType" : "timestamp-millis"
},
"doc" : "Unix time in milliseconds for the creation of this object. See: https://docs.com"
}
This field would be used to document the intended use:
"doc" : "Unix time in milliseconds for the creation of this object. See: https://docs.com"
Hi,
I am having issue generate python classes with this schema input
{
"namespace": "com.edmw.issuerlist",
"type": "record",
"name": "IssuerListMember",
"fields": [
{"name": "IssuerListCode", "type": "string"},
{"name": "IssuerUniqueIdentifiers", "type": {"type" : "array", "items": "long"}},
{"name": "LastUpdateTimestamp", "type": {
"type": "long",
"logicalType": "timestamp-millis"
}},
{
"default": null,
"name": "IssuerMarketCap",
"type": [
"null",
{
"logicalType": "decimal",
"precision": 38,
"scale": 8,
"type": "bytes"
}
]
}
]
}
Here is the stack trace:
(venv) C:\Users\----\JetBrain\workspace\python\kafka_learning>fastavro_gen IssuerList.avsc
Parsing schema/s for IssuerList.avsc
Generate dataclasss...
Traceback (most recent call last):
File "C:\Users\----\Python38\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\----\Python38\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\----\JetBrain\workspace\python\kafka_learning\venv\Scripts\fastavro_gen.exe\__main__.py", line 7, in <module>
File "c:\users\----\jetbrain\workspace\python\kafka_learning\venv\lib\site-packages\fastavro_gen\__main__.py", line 56, in main
read_schemas_and_generate_classes(
File "c:\users\----\jetbrain\workspace\python\kafka_learning\venv\lib\site-packages\fastavro_gen\type_gen.py", line 280, in read_schemas_and_generate_classes
generate_classes(
File "c:\users\----\jetbrain\workspace\python\kafka_learning\venv\lib\site-packages\fastavro_gen\type_gen.py", line 243, in generate_classes
write_schema(
File "c:\users\----\jetbrain\workspace\python\kafka_learning\venv\lib\site-packages\fastavro_gen\type_gen.py", line 214, in write_schema
write_record(
File "c:\users\----\jetbrain\workspace\python\kafka_learning\venv\lib\site-packages\fastavro_gen\type_gen.py", line 164, in write_record
t = _parse_type(field["type"], collector, namespace_prefix=namespace_prefix)
File "c:\users\----\jetbrain\workspace\python\kafka_learning\venv\lib\site-packages\fastavro_gen\type_gen.py", line 71, in _parse_type
return f"Optional[{_parse_type(_other[0], collector, namespace_prefix=namespace_prefix)}]"
File "c:\users\----\jetbrain\workspace\python\kafka_learning\venv\lib\site-packages\fastavro_gen\type_gen.py", line 78, in _parse_type
return _parse_dict_type(_type, collector, namespace_prefix=namespace_prefix)
File "c:\users\----\jetbrain\workspace\python\kafka_learning\venv\lib\site-packages\fastavro_gen\type_gen.py", line 109, in _parse_dict_type
raise Exception(f"Failed parsing type {_type}")
Exception: Failed parsing type {'logicalType': 'decimal', 'precision': 38, 'scale': 8, 'type': 'bytes'}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.