timestamp-millis bug introduced in 0.14. Works in 0.13
See original GitHub issueThe following simple program worked perfectly in fastavro 0.13 and now fails on fastavro 0.14. I presume this is a bug?
from io import BytesIO
import datetime
import fastavro
avro_schema = {
"type": "record",
"name": "simple_record",
"namespace": "org.test",
"fields": [{
"name": "name",
"type": "string"
}, {
"name": "timestamp",
"type": {
"type": "long",
"logicalType": "timestamp-millis"
}
}]
}
epoch = datetime.datetime.utcfromtimestamp(0)
def datetime_to_epoch_millis(dt):
return long((dt - epoch).total_seconds() * 1.0e3)
def generate_avro():
avro_dict = {
"name": "abc",
"timestamp": datetime_to_epoch_millis(datetime.datetime(2015, 6, 7, 15, 30, 0))
}
with BytesIO() as bytes_io:
fastavro.schemaless_writer(bytes_io, avro_schema, avro_dict)
return bytes_io.getvalue()
if __name__ == "__main__":
print("generate_avro test...")
avro_binary = generate_avro()
print("done :)")
print("length={}".format(len(avro_binary)))
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
timestamp-millis bug introduced in 0.14. Works in 0.13 #81
The following simple program worked perfectly in fastavro 0.13 and now fails on fastavro 0.14. I presume this is a bug? from io...
Read more >Serialization Formats - ksqlDB Documentation
Any statement that sets the key format to NONE and has key columns defined, will result in an error. If a CREATE TABLE...
Read more >https://raw.githubusercontent.com/arangodb/arangod...
Fixed bug in error reporting when a database create did not work, ... In previous ArangoDB versions, query ids always started at value...
Read more >Talend Component Kit Developer Reference Guide
Bug $. TCOMP-1839: Tomcat websocket server fails to start after tomcat 9.0.40 and meecrowave 1.2.10 · Work Item$. TCOMP-1836: Upgrade OpenWebBeans to 2.0.20....
Read more >[Rust] [Parquet] Corrupt footer error on files produced by ...
I started to use rust parquet library for some basic reading of files ... event_time: OPTIONAL INT64 L:TIMESTAMP(MILLIS,true) R:0 D:1 city: ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for reporting, will check.
Thanks for testing.
Fixed in 0.14.2