Skip to content

Support encoding with fastavro #492

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 4, 2018
Merged

Support encoding with fastavro #492

merged 5 commits into from
Dec 4, 2018

Conversation

rnpridgeon
Copy link
Contributor

wrap up work contributed by #419

@@ -140,13 +140,9 @@ def encode_record_with_schema_id(self, schema_id, record, is_key=False):
with ContextStringIO() as outf:
# write the header
# magic byte
outf.write(struct.pack('b', MAGIC_BYTE))

# write the schema ID in network byte order (big end)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this comment still applies though

Copy link
Contributor

@edenhill edenhill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -136,19 +140,11 @@ def encode_record_with_schema_id(self, schema_id, record, is_key=False):
with ContextStringIO() as outf:
# write the header
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: these three comment lines read strange now. combine them into one.

# write the schema ID in network byte order (big end)

outf.write(struct.pack('>I', schema_id))
# Write the magic byte and schema ID in network byte order (big end)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

micronit: "big endian" (from original comment though)

@@ -138,7 +138,7 @@ def encode_record_with_schema_id(self, schema_id, record, is_key=False):
# get the writer
writer = self.id_to_writers[schema_id]
with ContextStringIO() as outf:
# Write the magic byte and schema ID in network byte order (big end)
# Write the magic byte and schema ID in network byte order (big endian)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great fix!

@rnpridgeon rnpridgeon merged commit 160c1c0 into master Dec 4, 2018
@rnpridgeon rnpridgeon deleted the fast_avro_writer branch December 4, 2018 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants