RawScape opened a new pull request, #3727:
URL: https://github.com/apache/avro/pull/3727

   ## What is the purpose of the change
   
   This pull request resolves AVRO-2825 where the C# implementation threw a 
`SchemaParseException` or `AvroTypeException` when encountering unrecognized 
Logical Types. This behavior was inconsistent with the Avro specification and 
the Java implementation, which should fall back to the underlying base type.
   
   This is a takeover of PR #2751. In addition to bringing the code up to date 
with the current `main` branch, this PR addresses the following:
   * **Core Parser Fix:** Resolved a bug in `LogicalSchema.NewInstance` where 
logical types applied to flattened complex types (like enums or records) caused 
a crash because the base type name was passed to the parser without its 
required properties (symbols, fields, etc.).
   * **Review Feedback:** Addressed all open comments from the original PR 
regarding syntax (trailing commas) and logic (incorrect use of nullable byte 
arrays).
   
   ## Verifying this change
   
   This change added and refactored tests and can be verified as follows:
   
   - Refactored `AvroGenSchemaTests.cs`: Renamed `NotSupportedSchema` to 
`UnknownLogicalTypesFallbackToBaseType` and updated assertions to verify that 
both primitive and complex schemas with unknown logical types now result in 
successful code generation (exit code 0).
   - Updated `UnknownLogicalTypeTests.cs`: Corrected 
`TestGetCSharpType_IsFalse` to handle reference types (`string`, `byte[]`) 
properly, ensuring tests no longer fail due to the lack of runtime distinction 
for nullable reference types.
   - Manually verified that the fix in `LogicalSchema.cs` correctly clones the 
JSON token and strips the `logicalType` property to allow recursive parsing of 
complex base schemas without infinite loops.
   
   ## Documentation
   
   - Does this pull request introduce a new feature? **No**
   - If yes, how is the feature documented? **Not applicable**


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to