Add option to use default case class value during decoding of AvroTransient field#904
Merged
Merged
Conversation
Owner
|
FYI failing tests |
Contributor
Author
|
It fails on import pgp key. Not sure if it is part of the test. I will have a look |
Owner
|
Might just need keys updated for latest central ? |
Contributor
Author
|
Sam I've added pgp key to the project setting I think it was the reason why it failed . Could you please try it again |
Owner
|
Ran again |
Contributor
Author
|
Sam I added condition to run gpg steps only if PR is not from fork . |
ec6d3ae to
0ed5b47
Compare
0ed5b47 to
f276b4f
Compare
Contributor
Author
|
@sksamuel it is green now :) |
Owner
|
Merged! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello,
My use case is read data in protobuf format and translate it into avro format.
For protobuf I use scalapb library and it generates model case classes based on protobuf schema.
Generated case classes have UnknownFieldSet filed with default empty value. (There is an option to exclude them but I need them for analysis).
scalapballows to inject annatations into generated classes (https://scalapb.github.io/docs/customizations#adding-annotations) so to excludeUnknownFieldSetfiled from avro schema I useAvroTransientannotation. Everything works fine one model fror protobuf and avro but whenavro4stries to decode value that is marked withAvroTransientit returns None which cause class cast exception.I added
useDefaultboolean flag intoAvroTransientso now if it is true defalut value from the case class is used istead on none