-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
AVRO-2825: [csharp] Resolve: C# Logical Types throw exception on unkn… #2751
base: main
Are you sure you want to change the base?
Conversation
resolved all identified issues in new PR |
We need a C# developer/user to review the changes. |
Is there something I need to do to allow this PR to move forward? |
/// </summary> | ||
/// <param name="nullible">A flag indicating whether it should be nullible.</param> | ||
/// <returns>Type.</returns> | ||
public override Type GetCSharpType(bool nullible) |
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.
perhaps you meant nullable instead of nullible?
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.
I agree with your comment but that name pre-existed in many files in this codebase so I choose to be consistent.
I am not sure why this still shows are changes requested, they all have been made to my knowledge. |
all changes made |
LGTM. Thanks @TomBruns! |
@@ -45,7 +45,7 @@ private LogicalTypeFactory() | |||
{ TimeMicrosecond.LogicalTypeName, new TimeMicrosecond() }, | |||
{ TimestampMillisecond.LogicalTypeName, new TimestampMillisecond() }, | |||
{ TimestampMicrosecond.LogicalTypeName, new TimestampMicrosecond() }, | |||
{ Uuid.LogicalTypeName, new Uuid() } | |||
{ Uuid.LogicalTypeName, new Uuid() }, |
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.
Remove comma plz
AVRO-2825
What is the purpose of the change
NOTE: This PR WILL change the behavior of the current nuget package. It corrects it to align with the AVRO spec.
This is a new version of PR #2741 incorporating all feedback from KalleOlaviNiemitalo
Avoid swallowing any exceptions thrown for other reasons.
Allow applications to parse a schema and read the name of the logical type from LogicalSchema.LogicalTypeName (or even LogicalType.Name) regardless of whether the library recognizes it.
Allow applications to parse a schema and serialize it back to JSON without losing the unrecognized logical types here:
LogicalSchema.LogicalType could then be null, or perhaps an instance of a new NotSupportedLogicalType class that would pass everything through without conversion. (I created a new type: UnknownLogicalType)
Verifying this change
This change is already covered by existing tests:
test > AvroGen > AvroGenSchemaTests.cs > NotSupportedSchema
test > Schema > SchemaTests.cs > TestUnknownLogical
This change added tests and can be verified as follows:
Documentation