You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by GitBox <gi...@apache.org> on 2022/11/07 16:34:08 UTC

[GitHub] [avro] heartlabs opened a new pull request, #1945: AVRO-3663: [Rust] Allow raw identifiers as field names

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

   ## What is the purpose of the change
   
   When using a raw identifier as field name, the `r#` prefix was used as field name for the resulting schema which results in an invalid AVRO schema. This fix removes that prefix as it would be expected.
   
   ## Verifying this change
   
   This change added tests which can be used to verify the fix.
   


-- 
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: dev-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] martin-g commented on pull request #1945: AVRO-3663: [Rust] Allow raw identifiers as field names

Posted by GitBox <gi...@apache.org>.
martin-g commented on PR #1945:
URL: https://github.com/apache/avro/pull/1945#issuecomment-1306159438

   Thank you for the report and the fix, @heartlabs !
   Thank you for the review, @jklamer !


-- 
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: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] martin-g merged pull request #1945: AVRO-3663: [Rust] Allow raw identifiers as field names

Posted by GitBox <gi...@apache.org>.
martin-g merged PR #1945:
URL: https://github.com/apache/avro/pull/1945


-- 
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: dev-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] martin-g commented on a diff in pull request #1945: AVRO-3663: [Rust] Allow raw identifiers as field names

Posted by GitBox <gi...@apache.org>.
martin-g commented on code in PR #1945:
URL: https://github.com/apache/avro/pull/1945#discussion_r1015845801


##########
lang/rust/avro_derive/tests/derive.rs:
##########
@@ -1545,4 +1545,21 @@ mod test_derive {
             c: 987.654,
         });
     }
+
+
+    #[test]
+    fn test_raw_identifier_field_name() {     

Review Comment:
   ```suggestion
       fn test_avro_3663_raw_identifier_field_name() {     
   ```



##########
lang/rust/avro_derive/tests/derive.rs:
##########
@@ -1545,4 +1545,21 @@ mod test_derive {
             c: 987.654,
         });
     }
+
+
+    #[test]
+    fn test_raw_identifier_field_name() {     
+        #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq)]
+        struct TestRawIdent {
+            r#type: bool
+        }
+
+        let derived_schema = TestRawIdent::get_schema();
+        if let Schema::Record { fields, .. } = derived_schema {
+            let field = fields.get(0).expect("TestRawIdent must contain a field");
+            assert_eq!(field.name, "type");
+        } else {
+            panic!("Unexpected schema type")

Review Comment:
   ```suggestion
               panic!("Unexpected schema type for {:?}", derived_schema)
   ```



-- 
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: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org