-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix an incorrect string comparison in avro-python3 leading to corrupted files #220
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
Fix an incorrect string comparison in avro-python3 leading to corrupted files #220
Conversation
The corrected code was trying to compare the bytes value returned by GetMeta against a string. The if was never taken and this was leading to corrupted files when the snappy codes is used.
|
+1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. The codec is set after ensuring UTF8 decoding. Can you take the case provided and turn it into a py-test case for ./build.sh test unit validation?
|
Is there a JIRA with this issue? If not can you create one? |
|
@spacharya, there is: Can you comment if there is a new release planned soon? I hope this simple fix will be able to make it in the release. |
Once you add the test, I will merge it in. Do you intend to have this in a 1.8 release or 1.9 release? |
|
We should get this into any release line impacted by the bug. @zah, if you don't have time to make a test we can file a follow on JIRA to get it added later. |
|
Sorry, I was planning to study how test cases are added to the suite, but my work schedule got busier and I had to move on to other things. My initial comment actually provides a minimal test case, so anyone who is more familiar with the test suite can easily add it. Thanks a lot for your extra efforts to merge this into all release lines. |
kojiromike
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you look at lines 263 and 286, you can tell that this is a correct change. Tests are nice, but this one is pretty self-evident. I'd like to see this get merged.
However, since this one has been languishing, someone will need to kick off tests on it that have been put in place since it was written. @Fokko is there a way to do that without having to ask the original maintainer to do a rebase on a very old, one-line-change PR?
|
@kojiromike Unfortunately is no easy way to do that. I've added |
|
👏 It passed @Fokko :) |
|
Awesome! |
The corrected code was trying to compare the bytes value returned by GetMeta against a string.
The if was never taken and this was leading to corrupted files when the snappy codes is used.
Here is a minimal test case that demonstrates the issue: